add example generation on chat page #168
Draft
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.
Description
Added an example generation function on the chat tab based on the Content Heavy Prototype.
Implementation Details
frontend/src/pages/chat/index.tsxWhen the user clicks the example generation button, a
suggestExamples()request is sent.backend/nlp.py&backend/server.pyAdded payload support required for future web search requests.
Although the current example request is a plain generation request, there is support for web search requests.
Web search requests require an additional payload, such as:
tools: [{ type: "web_search_preview" }]Problems
The original plan for example generation focused on providing reliable links. However, the current OpenAI model used in our app does not seem to support URL-related functionality.
According to the official documentation, a web search request response should include an
annotationsobject. However, when implementing a web search preview request, the response did not contain theannotationsobject.For this reason, a plain generation request was implemented for this branch. However, URL gernation have failed again. It appears that the model currently used by our app does not support web search functionality.