-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Better generation of optimized search query #641
Comments
I am very interested in your suggestions because I also encounter the same problem as you mentioned. Can you state in detail the structure you built for |
Currently in [
{
"role": "user"
"content": "what is abc?"
},
{
"role": "assistant"
"content": "abc definition"
},
{
"role": "user"
"content": "what is def?"
},
{
"role": "assistant"
"content": "def definition"
},
{
"role": "user"
"content": "define both"
},
{
"role": "assistant"
"content": "definition of abc and def"
},
] As stated, we glue prompt + few shots on start and add current user query in the end (with the prefix). After that prefix is not present anymore in 'real' query messages history. |
Thanks so much for sharing your approach! |
Yes please share the PR, I have also put up a PR to stabilize the generation for lengthy chats using function calls. It should address most of the concerns. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed. |
Re-opened, I'm still interested in this. I don't have multi-turn evaluation setup yet, only single-turn (as you can see in #967) so I haven't been able to evaluate this change programmatically. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed. |
This issue is for a: (mark with an
x
)This is not really a bug so I am marking it as
feature
We are productionizing this PoC for corporate usage and found out few things that make the bot works better / smoother and generate more predictable queries that are sent to Cognitive Search - at least in our tests.
Right now in code, optimized search query in
chatreadretrieveread.py
is generated by gluing together:This works pretty well, however on longer conversation chain we found out that that query can get messy, as after few shots there is real conversation history - with question answers - which seems out of place here.
We came up with a simple idea of keeping history of user questions and queries generated by the bot as separate field in the request and response, which allows as to bounce these and keep the backend stateless.
So in the end - after implementation - generation of optimized search query messages would look like this:
If you guys think this approach sounds good, I can open PR with proposed changes. Thanks!
The text was updated successfully, but these errors were encountered: