Skip to content

Commit

Permalink
Add base_url for openai
Browse files Browse the repository at this point in the history
  • Loading branch information
vegito22 committed Sep 25, 2024
1 parent ae10e42 commit 888af8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llmstack/processors/providers/promptly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class PromptlyProviderConfig(ProviderConfig):


def get_llm_client_from_provider_config(provider, model_slug, get_provider_config_fn):
base_url = None
try:
google_provider_config = get_provider_config_fn(
provider_slug="google",
Expand Down Expand Up @@ -165,11 +166,15 @@ def get_llm_client_from_provider_config(provider, model_slug, get_provider_confi
elif google_provider_config.api_key:
google_api_key = google_provider_config.api_key

if openai_provider_config and openai_provider_config.base_url:
base_url = openai_provider_config.base_url

return LLM(
provider=provider,
openai_api_key=openai_provider_config.api_key if openai_provider_config else "",
stabilityai_api_key=stability_provider_config.api_key if stability_provider_config else "",
google_api_key=google_api_key if google_api_key else "",
anthropic_api_key=anthropic_provider_config.api_key if anthropic_provider_config else "",
cohere_api_key=cohere_provider_config.api_key if cohere_provider_config else "",
base_url=base_url,
)

0 comments on commit 888af8f

Please sign in to comment.