From ee33b4e2a3b029bdf0b005db5d0d548b7702f71a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 25 Sep 2024 22:34:02 +0200 Subject: [PATCH] fix: ollama /embed form_data --- backend/open_webui/apps/ollama/main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/apps/ollama/main.py b/backend/open_webui/apps/ollama/main.py index 6c639268e..1337fbb31 100644 --- a/backend/open_webui/apps/ollama/main.py +++ b/backend/open_webui/apps/ollama/main.py @@ -543,10 +543,18 @@ class GenerateEmbeddingsForm(BaseModel): keep_alive: Optional[Union[int, str]] = None +class GenerateEmbedForm(BaseModel): + model: str + input: str + truncate: Optional[bool] + options: Optional[dict] = None + keep_alive: Optional[Union[int, str]] = None + + @app.post("/api/embed") @app.post("/api/embed/{url_idx}") async def generate_embeddings( - form_data: GenerateEmbeddingsForm, + form_data: GenerateEmbedForm, url_idx: Optional[int] = None, user=Depends(get_verified_user), ):