Open kgilpin opened 2 weeks ago
Title: Implement Feature to Discard Navie Answer and Reload Question
Problem: Users need the ability to discard an answer from Navie that they find unsatisfactory. Discarding an answer should remove it from the UI, reload the question into the input box for amendment, and cause the discarded answer and its question to be ignored in the chat history.
Analysis: The feature requires modifications in both the user interface and the backend chat logic. From the user's perspective, discarding an answer involves removing it visually and re-presenting the original question for correction. Behind the scenes, it requires adjusting how the chat history is stored and referenced, ensuring that discarded answers and their associated questions do not impact future exchanges or history retrieval operations.
There needs to be a clear mechanism to toggle or flag specific exchanges (consisting of a question and its answer) as discarded, so they are omitted from any future operations involving chat history, such as displaying past interactions or analyzing conversation context. This can be achieved by modifying exchanges
to support a "discarded" state for each exchange.
Proposed Changes:
Frontend Adjustments:
Backend Changes:
packages/cli/src/rpc/explain/navie/thread.ts
):
Exchange
data structure to include a discarded
flag (boolean).Thread
class to mark the most recent exchange as discarded.setAnswer
and other relevant methods check for the discarded
flag and ignore exchanges where discarded
is true
.Chat History Management (packages/cli/src/rpc/explain/navie/history.ts
and packages/cli/src/rpc/explain/navie/ihistory.ts
):
User Experience Flow (packages/navie/src/services/classification-service.ts
):
Testing:
By implementing these changes, users can effectively manage the quality of interaction they have with Navie, discarding and refining questions as needed without cluttering the active history.
When Navie produces an answer that the user doesn't like, the answer can be discarded.
Discarding the answer has the following effects: