This repository was archived by the owner on Jan 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 595
Backend for editing previous queries #780
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…n load and store messages to conversation.rs
…AI/bloop into gabriel/blo-1297-rephrase-question
oppiliappan
reviewed
Jul 27, 2023
oppiliappan
previously requested changes
Jul 27, 2023
| repoName: string; | ||
| isLoading?: boolean; | ||
| isHistory?: boolean; | ||
| onMessageEdit: (parentQueryId: string, i: number) => void; |
Contributor
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.
i believe some of this logic has changed: 047ccbf
rsdy
reviewed
Jul 27, 2023
This generally reduces response sizes, by removing information that the front-end does not use.
5b80c46 to
4315133
Compare
…AI/bloop into gabriel/blo-1297-rephrase-question
…AI/bloop into gabriel/blo-1297-rephrase-question
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change set allows users to rephrase a query that they've already made and get a new answer. This is similar functionality to ChatGPT, but whereas they persist both the original and rephrased versions of a query (and their successive conversation states), we only store the state after query rephrasing, discarding everything else.
The approach is to add an additional
parent_query_idparameter to/answer:On receiving this payload the backend loads the
Conversationbythread_idfrom SQLite. But, rather than using the entire history as context, we truncateVec<Exchanges>at the point at whichExchange.id == parent_exchange_id. We only use the history up toparent_query_idas context.To get this working a major refactor of
answer.rswas in order:llm_history. This information is now reproducible fromVec<Exchange>using thehistory()method which iterates over exchanges and builds a linear sequence ofMessagepathsandcode_chunksintoExchange. EachExchangein a conversation now stores the paths andcode_chunksthat were discovered by its functions. The conversation-levelpathandcode_chunkstate is now reproducible withcode_chunks()andpaths()methods onAgent. Code chunk canonicalisation now happens on the fly, but this shouldn't give a noticeable performance hitStartStepandEndStepupdate types. We use these to tell the frontend that a step has started, and that it's ended.EndStepadds the result of the function to theExchangeConversationstruct. All functionality is now implemented onAgent.Todo (this PR)
parent_query_idTodo (future PR)
Agentout ofwebserver