From 888af8f7ac864b7bfcefe1578df8d8f1b7978e90 Mon Sep 17 00:00:00 2001 From: Vignesh Aigal Date: Wed, 25 Sep 2024 14:45:13 -0700 Subject: [PATCH] Add base_url for openai --- llmstack/processors/providers/promptly/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/llmstack/processors/providers/promptly/__init__.py b/llmstack/processors/providers/promptly/__init__.py index 6895f7d31fc..250152e55d6 100644 --- a/llmstack/processors/providers/promptly/__init__.py +++ b/llmstack/processors/providers/promptly/__init__.py @@ -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", @@ -165,6 +166,9 @@ 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 "", @@ -172,4 +176,5 @@ def get_llm_client_from_provider_config(provider, model_slug, get_provider_confi 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, )