-
Notifications
You must be signed in to change notification settings - Fork 988
Enable text-only vector search #1430
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
base: dev
Are you sure you want to change the base?
Conversation
CI Feedback 🧐(Feedback updated until commit 246f3a2)A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
| if not search_params.text: | ||
| raise HTTPException(status_code=400, detail="text is required for vector search") | ||
| [search_params.vector, *_] = await litellm.aembedding( | ||
| inputs=search_params.text, | ||
| embed_instruction="Represent the query for retrieving supporting documents: ", | ||
| user=str(x_developer_id), | ||
| ) | ||
|
|
||
| if isinstance(search_params, HybridDocSearchRequest) and search_params.vector is None: | ||
| [search_params.vector, *_] = await litellm.aembedding( | ||
| inputs=search_params.text, | ||
| embed_instruction="Represent the query for retrieving supporting documents: ", | ||
| user=str(x_developer_id), | ||
| ) |
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.
wouldn't the addition of the text field mess up the union type for search_param parameter? By introducing text to the vector search and making vector field optional.
A suggestion would be adding a mode field to all search types to specify what type to use while searching.
Summary
Testing
ruff format agents-api/agents_api/routers/docs/search_docs.py agents-api/tests/test_docs_routes.py agents-api/agents_api/autogen/Docs.pyruff check agents-api/agents_api/routers/docs/search_docs.py agents-api/tests/test_docs_routes.py agents-api/agents_api/autogen/Docs.pypyright agents-api(fails: Import "ward" could not be resolved)