diff --git a/agents-api/agents_api/clients/litellm.py b/agents-api/agents_api/clients/litellm.py index 0319f384f..9b321cc29 100644 --- a/agents-api/agents_api/clients/litellm.py +++ b/agents-api/agents_api/clients/litellm.py @@ -14,7 +14,7 @@ @wraps(_acompletion) @beartype async def acompletion( - *, model: str, messages: list[dict], custom_api_key: str = None, **kwargs + *, model: str, messages: list[dict], custom_api_key: None | str = None, **kwargs ) -> ModelResponse | CustomStreamWrapper: supported_params = get_supported_openai_params(model) diff --git a/agents-api/agents_api/models/docs/search_docs_by_embedding.py b/agents-api/agents_api/models/docs/search_docs_by_embedding.py index acebd09cd..d6bed97fc 100644 --- a/agents-api/agents_api/models/docs/search_docs_by_embedding.py +++ b/agents-api/agents_api/models/docs/search_docs_by_embedding.py @@ -194,11 +194,11 @@ def search_docs_by_embedding( """ collect_query = """ - m[ + n[ doc_id, owner_type, owner_id, - collect(snippet), + unique(snippet_data), distance, title, ] := @@ -209,11 +209,30 @@ def search_docs_by_embedding( snippet_data, distance, title, - }, snippet = { - "index": snippet_data->0, - "content": snippet_data->1, } + m[ + doc_id, + owner_type, + owner_id, + collect(snippet), + distance, + title, + ] := + n[ + doc_id, + owner_type, + owner_id, + snippet_data, + distance, + title, + ], + snippet = { + "index": snippet_datum->0, + "content": snippet_datum->1 + }, + snippet_datum in snippet_data + ?[ id, owner_type,