feat: make embedding support list of string as input

makes the /v1/embedding route similar to OpenAI api.
This commit is contained in:
Simon Chabot
2023-05-20 01:23:32 +02:00
parent 01a010be52
commit e783f1c191
2 changed files with 30 additions and 18 deletions

View File

@@ -275,7 +275,7 @@ def create_completion(
class CreateEmbeddingRequest(BaseModel):
model: Optional[str] = model_field
input: str = Field(description="The input to embed.")
input: Union[str, List[str]] = Field(description="The input to embed.")
user: Optional[str]
class Config: