fix batch embeddings

This commit is contained in:
Ashwin Bharambe 2025-10-12 18:56:29 -07:00
parent e6428492e6
commit bbdde4ec12

View file

@ -25,6 +25,7 @@ from llama_stack.apis.inference import (
OpenAIChatCompletionRequestWithExtraBody, OpenAIChatCompletionRequestWithExtraBody,
OpenAICompletionRequestWithExtraBody, OpenAICompletionRequestWithExtraBody,
OpenAIDeveloperMessageParam, OpenAIDeveloperMessageParam,
OpenAIEmbeddingsRequestWithExtraBody,
OpenAIMessageParam, OpenAIMessageParam,
OpenAISystemMessageParam, OpenAISystemMessageParam,
OpenAIToolMessageParam, OpenAIToolMessageParam,
@ -640,7 +641,9 @@ class ReferenceBatchesImpl(Batches):
}, },
} }
else: # /v1/embeddings else: # /v1/embeddings
embeddings_response = await self.inference_api.openai_embeddings(**request.body) embeddings_response = await self.inference_api.openai_embeddings(
OpenAIEmbeddingsRequestWithExtraBody(**request.body)
)
assert hasattr(embeddings_response, "model_dump_json"), ( assert hasattr(embeddings_response, "model_dump_json"), (
"Embeddings response must have model_dump_json method" "Embeddings response must have model_dump_json method"
) )