Spaces:
Sleeping
Sleeping
limcheekin
commited on
Commit
•
30b33a5
1
Parent(s):
9190101
feat: fixed server to work with pydantic v2
Browse files
open/text/embeddings/server/app.py
CHANGED
@@ -37,16 +37,19 @@ def create_app():
|
|
37 |
|
38 |
class CreateEmbeddingRequest(BaseModel):
|
39 |
model: Optional[str] = Field(
|
40 |
-
description="The model to use for generating embeddings.")
|
41 |
input: Union[str, List[str]] = Field(description="The input to embed.")
|
42 |
-
user: Optional[str]
|
43 |
-
|
44 |
-
|
45 |
-
json_schema_extra
|
46 |
-
"
|
47 |
-
|
48 |
-
|
|
|
|
|
49 |
}
|
|
|
50 |
|
51 |
|
52 |
class Embedding(BaseModel):
|
|
|
37 |
|
38 |
class CreateEmbeddingRequest(BaseModel):
|
39 |
model: Optional[str] = Field(
|
40 |
+
description="The model to use for generating embeddings.", default=None)
|
41 |
input: Union[str, List[str]] = Field(description="The input to embed.")
|
42 |
+
user: Optional[str] = Field(default=None)
|
43 |
+
|
44 |
+
model_config = {
|
45 |
+
"json_schema_extra": {
|
46 |
+
"examples": [
|
47 |
+
{
|
48 |
+
"input": "The food was delicious and the waiter...",
|
49 |
+
}
|
50 |
+
]
|
51 |
}
|
52 |
+
}
|
53 |
|
54 |
|
55 |
class Embedding(BaseModel):
|