Skip to content

Commit

Permalink
add groq and azure
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Jun 15, 2024
1 parent f6e3f6b commit 04e1574
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/funcchain/backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ class FuncchainSettings(BaseSettings):
azure_api_key: Optional[str] = None
anthropic_api_key: Optional[str] = None
google_api_key: Optional[str] = None
groq_api_key: Optional[str] = None
ollama_base_url: str = "http://localhost:11434"

# MODEL KWARGS
verbose: bool = False
streaming: bool = False
max_tokens: int = 2048
temperature: float = 0.1
api_version: str = "2024-02-01"

# LLAMACPP KWARGS
context_lenght: int = 8196
Expand All @@ -67,6 +69,11 @@ def openai_kwargs(self) -> dict:
"openai_api_key": self.openai_api_key,
}

def azure_kwargs(self) -> dict:
return {
"api_version": self.api_version,
}

def ollama_kwargs(self) -> dict:
return {
"base_url": self.ollama_base_url,
Expand Down Expand Up @@ -102,7 +109,7 @@ class SettingsOverride(TypedDict, total=False):

def create_local_settings(override: Optional[SettingsOverride] = None) -> FuncchainSettings:
if override:
if override["llm"] is None:
if override.get("llm") is None:
override["llm"] = settings.llm
return settings.model_copy(update=dict(override))
return settings
Expand Down

0 comments on commit 04e1574

Please sign in to comment.