-
Notifications
You must be signed in to change notification settings - Fork 7
Response API: Support non vector store assistants #242
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
Response API: Support non vector store assistants #242
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
backend/app/api/routes/responses.py
Outdated
| instructions=assistant.instructions, | ||
| temperature=assistant.temperature, | ||
| input=[{"role": "user", "content": request.question}], | ||
| ) |
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.
@AkhileshNegi We can refactor this
params = {
"model": assistant.model,
"previous_response_id": request.response_id,
"instructions": assistant.instructions,
"temperature": assistant.temperature,
"input": [{"role": "user", "content": request.question}],
}
if assistant.vector_store_id:
params["tools"] = [
{
"type": "file_search",
"vector_store_ids": [assistant.vector_store_id],
"max_num_results": assistant.max_num_results,
}
]
params["include"] = ["file_search_call.results"]
response = client.responses.create(**params)
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.
done, thanks for sharing
Summary
Target issue is #241
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes