From e5a1cdf554df629efb391a50266949f1c86f599b Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Sat, 11 Oct 2025 22:05:20 -0700 Subject: [PATCH] more fixes --- docs/static/deprecated-llama-stack-spec.html | 30 ++++--------------- docs/static/deprecated-llama-stack-spec.yaml | 27 ++++------------- docs/static/llama-stack-spec.html | 30 ++++--------------- docs/static/llama-stack-spec.yaml | 27 ++++------------- docs/static/stainless-llama-stack-spec.html | 30 ++++--------------- docs/static/stainless-llama-stack-spec.yaml | 27 ++++------------- llama_stack/apis/vector_io/vector_io.py | 4 +-- llama_stack/core/routers/vector_io.py | 12 +++----- .../utils/memory/openai_vector_store_mixin.py | 2 +- 9 files changed, 43 insertions(+), 146 deletions(-) diff --git a/docs/static/deprecated-llama-stack-spec.html b/docs/static/deprecated-llama-stack-spec.html index a3638749d..b83381749 100644 --- a/docs/static/deprecated-llama-stack-spec.html +++ b/docs/static/deprecated-llama-stack-spec.html @@ -2623,17 +2623,7 @@ ], "summary": "Create a vector store file batch.", "description": "Create a vector store file batch.\nGenerate an OpenAI-compatible vector store file batch for the given vector store.", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "description": "The ID of the vector store to create the file batch for.", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "content": { "application/json": { @@ -12154,19 +12144,6 @@ ] }, "description": "Set of key-value pairs that can be attached to the vector store" - }, - "embedding_model": { - "type": "string", - "description": "(Optional) The embedding model to use for this vector store" - }, - "embedding_dimension": { - "type": "integer", - "default": 384, - "description": "(Optional) The dimension of the embedding vectors (default: 384)" - }, - "provider_id": { - "type": "string", - "description": "(Optional) The ID of the provider to use for this vector store" } }, "additionalProperties": false, @@ -12344,6 +12321,10 @@ "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { "type": "object", "properties": { + "vector_store_id": { + "type": "string", + "description": "The ID of the vector store to create the file batch for" + }, "file_ids": { "type": "array", "items": { @@ -12384,6 +12365,7 @@ }, "additionalProperties": false, "required": [ + "vector_store_id", "file_ids" ], "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index 3cbcbc82b..d163e32f0 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -1932,14 +1932,7 @@ paths: Generate an OpenAI-compatible vector store file batch for the given vector store. - parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store to create the file batch for. - required: true - schema: - type: string + parameters: [] requestBody: content: application/json: @@ -9205,19 +9198,6 @@ components: - type: object description: >- Set of key-value pairs that can be attached to the vector store - embedding_model: - type: string - description: >- - (Optional) The embedding model to use for this vector store - embedding_dimension: - type: integer - default: 384 - description: >- - (Optional) The dimension of the embedding vectors (default: 384) - provider_id: - type: string - description: >- - (Optional) The ID of the provider to use for this vector store additionalProperties: false title: >- OpenAICreateVectorStoreRequestWithExtraBody @@ -9346,6 +9326,10 @@ components: "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": type: object properties: + vector_store_id: + type: string + description: >- + The ID of the vector store to create the file batch for file_ids: type: array items: @@ -9371,6 +9355,7 @@ components: auto additionalProperties: false required: + - vector_store_id - file_ids title: >- OpenAICreateVectorStoreFileBatchRequestWithExtraBody diff --git a/docs/static/llama-stack-spec.html b/docs/static/llama-stack-spec.html index c1aa41abc..2bf50e5c7 100644 --- a/docs/static/llama-stack-spec.html +++ b/docs/static/llama-stack-spec.html @@ -3357,17 +3357,7 @@ ], "summary": "Create a vector store file batch.", "description": "Create a vector store file batch.\nGenerate an OpenAI-compatible vector store file batch for the given vector store.", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "description": "The ID of the vector store to create the file batch for.", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "content": { "application/json": { @@ -12680,19 +12670,6 @@ ] }, "description": "Set of key-value pairs that can be attached to the vector store" - }, - "embedding_model": { - "type": "string", - "description": "(Optional) The embedding model to use for this vector store" - }, - "embedding_dimension": { - "type": "integer", - "default": 384, - "description": "(Optional) The dimension of the embedding vectors (default: 384)" - }, - "provider_id": { - "type": "string", - "description": "(Optional) The ID of the provider to use for this vector store" } }, "additionalProperties": false, @@ -12870,6 +12847,10 @@ "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { "type": "object", "properties": { + "vector_store_id": { + "type": "string", + "description": "The ID of the vector store to create the file batch for" + }, "file_ids": { "type": "array", "items": { @@ -12910,6 +12891,7 @@ }, "additionalProperties": false, "required": [ + "vector_store_id", "file_ids" ], "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index a66ceede8..d221c2129 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -2553,14 +2553,7 @@ paths: Generate an OpenAI-compatible vector store file batch for the given vector store. - parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store to create the file batch for. - required: true - schema: - type: string + parameters: [] requestBody: content: application/json: @@ -9670,19 +9663,6 @@ components: - type: object description: >- Set of key-value pairs that can be attached to the vector store - embedding_model: - type: string - description: >- - (Optional) The embedding model to use for this vector store - embedding_dimension: - type: integer - default: 384 - description: >- - (Optional) The dimension of the embedding vectors (default: 384) - provider_id: - type: string - description: >- - (Optional) The ID of the provider to use for this vector store additionalProperties: false title: >- OpenAICreateVectorStoreRequestWithExtraBody @@ -9811,6 +9791,10 @@ components: "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": type: object properties: + vector_store_id: + type: string + description: >- + The ID of the vector store to create the file batch for file_ids: type: array items: @@ -9836,6 +9820,7 @@ components: auto additionalProperties: false required: + - vector_store_id - file_ids title: >- OpenAICreateVectorStoreFileBatchRequestWithExtraBody diff --git a/docs/static/stainless-llama-stack-spec.html b/docs/static/stainless-llama-stack-spec.html index 717352b35..60865ef0b 100644 --- a/docs/static/stainless-llama-stack-spec.html +++ b/docs/static/stainless-llama-stack-spec.html @@ -3357,17 +3357,7 @@ ], "summary": "Create a vector store file batch.", "description": "Create a vector store file batch.\nGenerate an OpenAI-compatible vector store file batch for the given vector store.", - "parameters": [ - { - "name": "vector_store_id", - "in": "path", - "description": "The ID of the vector store to create the file batch for.", - "required": true, - "schema": { - "type": "string" - } - } - ], + "parameters": [], "requestBody": { "content": { "application/json": { @@ -14689,19 +14679,6 @@ ] }, "description": "Set of key-value pairs that can be attached to the vector store" - }, - "embedding_model": { - "type": "string", - "description": "(Optional) The embedding model to use for this vector store" - }, - "embedding_dimension": { - "type": "integer", - "default": 384, - "description": "(Optional) The dimension of the embedding vectors (default: 384)" - }, - "provider_id": { - "type": "string", - "description": "(Optional) The ID of the provider to use for this vector store" } }, "additionalProperties": false, @@ -14879,6 +14856,10 @@ "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { "type": "object", "properties": { + "vector_store_id": { + "type": "string", + "description": "The ID of the vector store to create the file batch for" + }, "file_ids": { "type": "array", "items": { @@ -14919,6 +14900,7 @@ }, "additionalProperties": false, "required": [ + "vector_store_id", "file_ids" ], "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index 4a5f7c8e0..3f9270b93 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -2556,14 +2556,7 @@ paths: Generate an OpenAI-compatible vector store file batch for the given vector store. - parameters: - - name: vector_store_id - in: path - description: >- - The ID of the vector store to create the file batch for. - required: true - schema: - type: string + parameters: [] requestBody: content: application/json: @@ -11115,19 +11108,6 @@ components: - type: object description: >- Set of key-value pairs that can be attached to the vector store - embedding_model: - type: string - description: >- - (Optional) The embedding model to use for this vector store - embedding_dimension: - type: integer - default: 384 - description: >- - (Optional) The dimension of the embedding vectors (default: 384) - provider_id: - type: string - description: >- - (Optional) The ID of the provider to use for this vector store additionalProperties: false title: >- OpenAICreateVectorStoreRequestWithExtraBody @@ -11256,6 +11236,10 @@ components: "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": type: object properties: + vector_store_id: + type: string + description: >- + The ID of the vector store to create the file batch for file_ids: type: array items: @@ -11281,6 +11265,7 @@ components: auto additionalProperties: false required: + - vector_store_id - file_ids title: >- OpenAICreateVectorStoreFileBatchRequestWithExtraBody diff --git a/llama_stack/apis/vector_io/vector_io.py b/llama_stack/apis/vector_io/vector_io.py index 3ced81bdd..17e9dae70 100644 --- a/llama_stack/apis/vector_io/vector_io.py +++ b/llama_stack/apis/vector_io/vector_io.py @@ -491,11 +491,13 @@ class OpenAICreateVectorStoreRequestWithExtraBody(BaseModel, extra="allow"): class OpenAICreateVectorStoreFileBatchRequestWithExtraBody(BaseModel, extra="allow"): """Request to create a vector store file batch with extra_body support. + :param vector_store_id: The ID of the vector store to create the file batch for :param file_ids: A list of File IDs that the vector store should use :param attributes: (Optional) Key-value attributes to store with the files :param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto """ + vector_store_id: str file_ids: list[str] attributes: dict[str, Any] | None = None chunking_strategy: VectorStoreChunkingStrategy | None = None @@ -847,13 +849,11 @@ class VectorIO(Protocol): ) async def openai_create_vector_store_file_batch( self, - vector_store_id: str, params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], ) -> VectorStoreFileBatchObject: """Create a vector store file batch. Generate an OpenAI-compatible vector store file batch for the given vector store. - :param vector_store_id: The ID of the vector store to create the file batch for. :returns: A VectorStoreFileBatchObject representing the created file batch. """ ... diff --git a/llama_stack/core/routers/vector_io.py b/llama_stack/core/routers/vector_io.py index 27e56fef2..b8ec69bbe 100644 --- a/llama_stack/core/routers/vector_io.py +++ b/llama_stack/core/routers/vector_io.py @@ -135,7 +135,7 @@ class VectorIORouter(VectorIO): logger.debug(f"VectorIORouter.openai_create_vector_store: name={params.name}, provider_id={provider_id}") # If no embedding model is provided, use the first available one - # TODO: this branch will soon be deleted so you _must_ provide the embedding_model when + # TODO: this branch will soon be deleted so you _must_ provide the embedding_model when # creating a vector store if embedding_model is None: embedding_model_info = await self._get_first_embedding_model() @@ -383,17 +383,13 @@ class VectorIORouter(VectorIO): async def openai_create_vector_store_file_batch( self, - vector_store_id: str, params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], ) -> VectorStoreFileBatchObject: logger.debug( - f"VectorIORouter.openai_create_vector_store_file_batch: {vector_store_id}, {len(params.file_ids)} files" - ) - provider = await self.routing_table.get_provider_impl(vector_store_id) - return await provider.openai_create_vector_store_file_batch( - vector_store_id=vector_store_id, - params=params, + f"VectorIORouter.openai_create_vector_store_file_batch: {params.vector_store_id}, {len(params.file_ids)} files" ) + provider = await self.routing_table.get_provider_impl(params.vector_store_id) + return await provider.openai_create_vector_store_file_batch(params) async def openai_retrieve_vector_store_file_batch( self, diff --git a/llama_stack/providers/utils/memory/openai_vector_store_mixin.py b/llama_stack/providers/utils/memory/openai_vector_store_mixin.py index 70bcbba32..23330a3d0 100644 --- a/llama_stack/providers/utils/memory/openai_vector_store_mixin.py +++ b/llama_stack/providers/utils/memory/openai_vector_store_mixin.py @@ -978,10 +978,10 @@ class OpenAIVectorStoreMixin(ABC): async def openai_create_vector_store_file_batch( self, - vector_store_id: str, params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], ) -> VectorStoreFileBatchObject: """Create a vector store file batch.""" + vector_store_id = params.vector_store_id if vector_store_id not in self.openai_vector_stores: raise VectorStoreNotFoundError(vector_store_id)