Skip to content

Commit a5f1f16

Browse files
committed
Move query and streaming_query to vector_stores
1 parent 8e414a2 commit a5f1f16

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/app/endpoints/query.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,10 @@ async def retrieve_response( # pylint: disable=too-many-locals,too-many-branche
683683
),
684684
}
685685

686-
vector_db_ids = [
687-
vector_db.identifier for vector_db in await client.vector_dbs.list()
686+
vector_store_ids = [
687+
vector_store.id for vector_store in (await client.vector_stores.list()).data
688688
]
689-
toolgroups = (get_rag_toolgroups(vector_db_ids) or []) + [
689+
toolgroups = (get_rag_toolgroups(vector_store_ids) or []) + [
690690
mcp_server.name for mcp_server in configuration.mcp_servers
691691
]
692692
# Convert empty list to None for consistency with existing behavior
@@ -782,30 +782,30 @@ def validate_attachments_metadata(attachments: list[Attachment]) -> None:
782782

783783

784784
def get_rag_toolgroups(
785-
vector_db_ids: list[str],
785+
vector_store_ids: list[str],
786786
) -> list[Toolgroup] | None:
787787
"""
788-
Return a list of RAG Tool groups if the given vector DB list is not empty.
788+
Return a list of RAG Tool groups if the given vector store list is not empty.
789789
790790
Generate a list containing a RAG knowledge search toolgroup if
791-
vector database IDs are provided.
791+
vector store IDs are provided.
792792
793793
Parameters:
794-
vector_db_ids (list[str]): List of vector database identifiers to include in the toolgroup.
794+
vector_store_ids (list[str]): List of vector store identifiers to include in the toolgroup.
795795
796796
Returns:
797797
list[Toolgroup] | None: A list with a single RAG toolgroup if
798-
vector_db_ids is non-empty; otherwise, None.
798+
vector_store_ids is non-empty; otherwise, None.
799799
"""
800800
return (
801801
[
802802
ToolgroupAgentToolGroupWithArgs(
803803
name="builtin::rag/knowledge_search",
804804
args={
805-
"vector_db_ids": vector_db_ids,
805+
"vector_store_ids": vector_store_ids,
806806
},
807807
)
808808
]
809-
if vector_db_ids
809+
if vector_store_ids
810810
else None
811811
)

src/app/endpoints/streaming_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,10 +1031,10 @@ async def retrieve_response(
10311031
),
10321032
}
10331033

1034-
vector_db_ids = [
1035-
vector_db.identifier for vector_db in await client.vector_dbs.list()
1034+
vector_store_ids = [
1035+
vector_store.id for vector_store in (await client.vector_stores.list()).data
10361036
]
1037-
toolgroups = (get_rag_toolgroups(vector_db_ids) or []) + [
1037+
toolgroups = (get_rag_toolgroups(vector_store_ids) or []) + [
10381038
mcp_server.name for mcp_server in configuration.mcp_servers
10391039
]
10401040
# Convert empty list to None for consistency with existing behavior

0 commit comments

Comments
 (0)