Skip to content

Fix: Add config definitions for parity with documentation #3448

@Beastmaster23

Description

@Beastmaster23

The api does not define all config keys. This doesn't allow api to return all keys that could be set. For reference llms/config, vectordbs/config, and embedders/config.

Possible Solutions

  • The naive approach is to define all keys in each config class.
  • Define different sub classes and instantiate based on the service and properties defined.
    Example:
    Before:
class EmbedderConfig(BaseModel):
    model: str = Field(..., description="Embedder model name")
    api_key: Optional[str] = Field(None, description="API key or 'env:API_KEY' to use environment variable")
    ollama_base_url: Optional[str] = Field(None, description="Base URL for Ollama server (e.g., http://host.docker.internal:11434)")

After:

class EmbedderConfig(BaseModel):
    model: str = Field(..., description="Embedder model name")
    api_key: Optional[str] = Field(None, description="API key or 'env:API_KEY' to use environment variable")
    embedding_dims: Optional[int] = Field(None, description="Embedding dimensions for the model")
    http_client_proxies: Optional[str] = Field(None, description="For any, set the http client proxies")

class OllamaEmbedderConfig(EmbedderConfig):
   ollama_base_url: Optional[str] = Field(None, description="Base URL for Ollama server (e.g., http://host.docker.internal:11434)")

class AzureEmbedderConfig(EmbedderConfig):
   azure_kwargs: Optional[str] = Field(None, description="Key-Value arguments for the AzureOpenAI embedding model")
  • Can make a factory method to create classes based on properties

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions