-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include context in user message #1006
Include context in user message #1006
Conversation
@@ -86,52 +90,19 @@ const ChatInput = forwardRef<{ focus: () => void }, ChatInputProps>( | |||
}, | |||
})); | |||
|
|||
const debounce = <T extends (...args: any[]) => any>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the debounce function and the effect that listens to input message change do the same thing. It caused duplicated context values. Tested that everything still works after removing all the debounce calls
adbdfb8
to
77209ba
Compare
Note that editing doesn't work as intended yet. It will make people think the edited message is sent with context but in reality it doesn't. Not sure if we want to push this change before we fix the issue. |
Right, let me look into fixing the edit and this one can rebase on that. |
I can look into this, too. It will be related to the edit UI work that will follow up on this one. |
Sounds good. Right now we have "hidden user message" that has added context in "handleSendMessage" in Chat.tsx. We also have some ad-hoc processing and appending to the user message using I think we need a clear design of a new ChatMessage object with context in it (currently in |
One thing to be careful about is that any context should be fresh in case the context notes have changed. It is working correctly at the moment for chat input, but we should avoid saving a previous context in an old ChatMessage object. |
77209ba
to
edac059
Compare
@logancyang I added the temporary fix for editing message as what we discussed on Friday. Not perfect but at least make it clear whether context is used in different scenario. The editing message has other issues, and I'd like to fix them in a separate PR. |
@zeroliu It's just the active note added to context menu manually |
7f0ae7c
to
352fcd8
Compare
@logancyang the current note issue is fixed. Although I'm not sure about the value of having a separate active note. It would simplify the logic a lot if we only have context notes. Food for thoughts. |
Pinged you in discord. There's a new issue where additional context in chat input don't get preserved after hitting send, only active note is preserved. |
352fcd8
to
8cdbee4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just as a note, in the follow up PRs we need to address
- Edit with context (better design of the chat message object)
- "Save as Note" and "Load" with context references
Render context with the user message.