more fixes

This commit is contained in:
Ashwin Bharambe 2025-10-11 22:05:20 -07:00
parent bf59d26362
commit e5a1cdf554
9 changed files with 43 additions and 146 deletions

View file

@ -2623,17 +2623,7 @@
], ],
"summary": "Create a vector store file batch.", "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.", "description": "Create a vector store file batch.\nGenerate an OpenAI-compatible vector store file batch for the given vector store.",
"parameters": [ "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"
}
}
],
"requestBody": { "requestBody": {
"content": { "content": {
"application/json": { "application/json": {
@ -12154,19 +12144,6 @@
] ]
}, },
"description": "Set of key-value pairs that can be attached to the vector store" "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, "additionalProperties": false,
@ -12344,6 +12321,10 @@
"OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": {
"type": "object", "type": "object",
"properties": { "properties": {
"vector_store_id": {
"type": "string",
"description": "The ID of the vector store to create the file batch for"
},
"file_ids": { "file_ids": {
"type": "array", "type": "array",
"items": { "items": {
@ -12384,6 +12365,7 @@
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"vector_store_id",
"file_ids" "file_ids"
], ],
"title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody",

View file

@ -1932,14 +1932,7 @@ paths:
Generate an OpenAI-compatible vector store file batch for the given vector Generate an OpenAI-compatible vector store file batch for the given vector
store. store.
parameters: 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
requestBody: requestBody:
content: content:
application/json: application/json:
@ -9205,19 +9198,6 @@ components:
- type: object - type: object
description: >- description: >-
Set of key-value pairs that can be attached to the vector store 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 additionalProperties: false
title: >- title: >-
OpenAICreateVectorStoreRequestWithExtraBody OpenAICreateVectorStoreRequestWithExtraBody
@ -9346,6 +9326,10 @@ components:
"OpenAICreateVectorStoreFileBatchRequestWithExtraBody": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody":
type: object type: object
properties: properties:
vector_store_id:
type: string
description: >-
The ID of the vector store to create the file batch for
file_ids: file_ids:
type: array type: array
items: items:
@ -9371,6 +9355,7 @@ components:
auto auto
additionalProperties: false additionalProperties: false
required: required:
- vector_store_id
- file_ids - file_ids
title: >- title: >-
OpenAICreateVectorStoreFileBatchRequestWithExtraBody OpenAICreateVectorStoreFileBatchRequestWithExtraBody

View file

@ -3357,17 +3357,7 @@
], ],
"summary": "Create a vector store file batch.", "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.", "description": "Create a vector store file batch.\nGenerate an OpenAI-compatible vector store file batch for the given vector store.",
"parameters": [ "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"
}
}
],
"requestBody": { "requestBody": {
"content": { "content": {
"application/json": { "application/json": {
@ -12680,19 +12670,6 @@
] ]
}, },
"description": "Set of key-value pairs that can be attached to the vector store" "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, "additionalProperties": false,
@ -12870,6 +12847,10 @@
"OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": {
"type": "object", "type": "object",
"properties": { "properties": {
"vector_store_id": {
"type": "string",
"description": "The ID of the vector store to create the file batch for"
},
"file_ids": { "file_ids": {
"type": "array", "type": "array",
"items": { "items": {
@ -12910,6 +12891,7 @@
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"vector_store_id",
"file_ids" "file_ids"
], ],
"title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody",

View file

@ -2553,14 +2553,7 @@ paths:
Generate an OpenAI-compatible vector store file batch for the given vector Generate an OpenAI-compatible vector store file batch for the given vector
store. store.
parameters: 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
requestBody: requestBody:
content: content:
application/json: application/json:
@ -9670,19 +9663,6 @@ components:
- type: object - type: object
description: >- description: >-
Set of key-value pairs that can be attached to the vector store 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 additionalProperties: false
title: >- title: >-
OpenAICreateVectorStoreRequestWithExtraBody OpenAICreateVectorStoreRequestWithExtraBody
@ -9811,6 +9791,10 @@ components:
"OpenAICreateVectorStoreFileBatchRequestWithExtraBody": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody":
type: object type: object
properties: properties:
vector_store_id:
type: string
description: >-
The ID of the vector store to create the file batch for
file_ids: file_ids:
type: array type: array
items: items:
@ -9836,6 +9820,7 @@ components:
auto auto
additionalProperties: false additionalProperties: false
required: required:
- vector_store_id
- file_ids - file_ids
title: >- title: >-
OpenAICreateVectorStoreFileBatchRequestWithExtraBody OpenAICreateVectorStoreFileBatchRequestWithExtraBody

View file

@ -3357,17 +3357,7 @@
], ],
"summary": "Create a vector store file batch.", "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.", "description": "Create a vector store file batch.\nGenerate an OpenAI-compatible vector store file batch for the given vector store.",
"parameters": [ "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"
}
}
],
"requestBody": { "requestBody": {
"content": { "content": {
"application/json": { "application/json": {
@ -14689,19 +14679,6 @@
] ]
}, },
"description": "Set of key-value pairs that can be attached to the vector store" "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, "additionalProperties": false,
@ -14879,6 +14856,10 @@
"OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": {
"type": "object", "type": "object",
"properties": { "properties": {
"vector_store_id": {
"type": "string",
"description": "The ID of the vector store to create the file batch for"
},
"file_ids": { "file_ids": {
"type": "array", "type": "array",
"items": { "items": {
@ -14919,6 +14900,7 @@
}, },
"additionalProperties": false, "additionalProperties": false,
"required": [ "required": [
"vector_store_id",
"file_ids" "file_ids"
], ],
"title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody",

View file

@ -2556,14 +2556,7 @@ paths:
Generate an OpenAI-compatible vector store file batch for the given vector Generate an OpenAI-compatible vector store file batch for the given vector
store. store.
parameters: 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
requestBody: requestBody:
content: content:
application/json: application/json:
@ -11115,19 +11108,6 @@ components:
- type: object - type: object
description: >- description: >-
Set of key-value pairs that can be attached to the vector store 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 additionalProperties: false
title: >- title: >-
OpenAICreateVectorStoreRequestWithExtraBody OpenAICreateVectorStoreRequestWithExtraBody
@ -11256,6 +11236,10 @@ components:
"OpenAICreateVectorStoreFileBatchRequestWithExtraBody": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody":
type: object type: object
properties: properties:
vector_store_id:
type: string
description: >-
The ID of the vector store to create the file batch for
file_ids: file_ids:
type: array type: array
items: items:
@ -11281,6 +11265,7 @@ components:
auto auto
additionalProperties: false additionalProperties: false
required: required:
- vector_store_id
- file_ids - file_ids
title: >- title: >-
OpenAICreateVectorStoreFileBatchRequestWithExtraBody OpenAICreateVectorStoreFileBatchRequestWithExtraBody

View file

@ -491,11 +491,13 @@ class OpenAICreateVectorStoreRequestWithExtraBody(BaseModel, extra="allow"):
class OpenAICreateVectorStoreFileBatchRequestWithExtraBody(BaseModel, extra="allow"): class OpenAICreateVectorStoreFileBatchRequestWithExtraBody(BaseModel, extra="allow"):
"""Request to create a vector store file batch with extra_body support. """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 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 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 :param chunking_strategy: (Optional) The chunking strategy used to chunk the file(s). Defaults to auto
""" """
vector_store_id: str
file_ids: list[str] file_ids: list[str]
attributes: dict[str, Any] | None = None attributes: dict[str, Any] | None = None
chunking_strategy: VectorStoreChunkingStrategy | None = None chunking_strategy: VectorStoreChunkingStrategy | None = None
@ -847,13 +849,11 @@ class VectorIO(Protocol):
) )
async def openai_create_vector_store_file_batch( async def openai_create_vector_store_file_batch(
self, self,
vector_store_id: str,
params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)],
) -> VectorStoreFileBatchObject: ) -> VectorStoreFileBatchObject:
"""Create a vector store file batch. """Create a vector store file batch.
Generate an OpenAI-compatible vector store file batch for the given vector store. 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. :returns: A VectorStoreFileBatchObject representing the created file batch.
""" """
... ...

View file

@ -383,17 +383,13 @@ class VectorIORouter(VectorIO):
async def openai_create_vector_store_file_batch( async def openai_create_vector_store_file_batch(
self, self,
vector_store_id: str,
params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)],
) -> VectorStoreFileBatchObject: ) -> VectorStoreFileBatchObject:
logger.debug( logger.debug(
f"VectorIORouter.openai_create_vector_store_file_batch: {vector_store_id}, {len(params.file_ids)} files" 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(vector_store_id)
return await provider.openai_create_vector_store_file_batch(
vector_store_id=vector_store_id,
params=params,
) )
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( async def openai_retrieve_vector_store_file_batch(
self, self,

View file

@ -978,10 +978,10 @@ class OpenAIVectorStoreMixin(ABC):
async def openai_create_vector_store_file_batch( async def openai_create_vector_store_file_batch(
self, self,
vector_store_id: str,
params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)], params: Annotated[OpenAICreateVectorStoreFileBatchRequestWithExtraBody, Body(...)],
) -> VectorStoreFileBatchObject: ) -> VectorStoreFileBatchObject:
"""Create a vector store file batch.""" """Create a vector store file batch."""
vector_store_id = params.vector_store_id
if vector_store_id not in self.openai_vector_stores: if vector_store_id not in self.openai_vector_stores:
raise VectorStoreNotFoundError(vector_store_id) raise VectorStoreNotFoundError(vector_store_id)