Skip to content

Commit

Permalink
fix: Make embedding_endpoint_type an enum (#2251)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattzh72 authored Dec 17, 2024
1 parent d5ef53c commit eba310c
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions letta/schemas/embedding_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Literal, Optional

from pydantic import BaseModel, Field

Expand All @@ -20,7 +20,25 @@ class EmbeddingConfig(BaseModel):
"""

embedding_endpoint_type: str = Field(..., description="The endpoint type for the model.")
embedding_endpoint_type: Literal[
"openai",
"anthropic",
"cohere",
"google_ai",
"azure",
"groq",
"ollama",
"webui",
"webui-legacy",
"lmstudio",
"lmstudio-legacy",
"llamacpp",
"koboldcpp",
"vllm",
"hugging-face",
"mistral",
"together", # completions endpoint
] = Field(..., description="The endpoint type for the model.")
embedding_endpoint: Optional[str] = Field(None, description="The endpoint for the model (`None` if local).")
embedding_model: str = Field(..., description="The model for the embedding.")
embedding_dim: int = Field(..., description="The dimension of the embedding.")
Expand Down

0 comments on commit eba310c

Please sign in to comment.