Skip to content

Commit

Permalink
Allow overriding the Ollama base URL
Browse files Browse the repository at this point in the history
- import TextField from providers
- add base_url to allow custom url for ollama embeddings provider
  • Loading branch information
sqlreport authored Sep 20, 2024
1 parent fcb2d71 commit cd588d0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
EnvAuthStrategy,
Field,
MultiEnvAuthStrategy,
TextField,
)
from langchain.pydantic_v1 import BaseModel, Extra
from langchain_community.embeddings import (
Expand Down Expand Up @@ -76,6 +77,9 @@ class OllamaEmbeddingsProvider(BaseEmbeddingsProvider, OllamaEmbeddings):
"snowflake-arctic-embed",
]
model_id_key = "model"
fields = [
TextField(key="base_url", label="Base API URL (optional)", format="text"),
]


class HfHubEmbeddingsProvider(BaseEmbeddingsProvider, HuggingFaceHubEmbeddings):
Expand Down

0 comments on commit cd588d0

Please sign in to comment.