From b94c646210d56539cf0814afd2d99051825cc55c Mon Sep 17 00:00:00 2001 From: kingbri Date: Sat, 16 Nov 2024 23:48:31 -0500 Subject: [PATCH] Embeddings: Add string input as an option Used in OAI's API Signed-off-by: kingbri --- endpoints/OAI/types/embedding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoints/OAI/types/embedding.py b/endpoints/OAI/types/embedding.py index 7d5779fa..7937d503 100644 --- a/endpoints/OAI/types/embedding.py +++ b/endpoints/OAI/types/embedding.py @@ -1,4 +1,4 @@ -from typing import List, Optional +from typing import List, Optional, Union from pydantic import BaseModel, Field @@ -10,7 +10,7 @@ class UsageInfo(BaseModel): class EmbeddingsRequest(BaseModel): - input: List[str] = Field( + input: Union[str, List[str]] = Field( ..., description="List of input texts to generate embeddings for." ) encoding_format: str = Field(