Skip to content

Commit

Permalink
🐛 Fix azure with custom key
Browse files Browse the repository at this point in the history
  • Loading branch information
awtkns committed Sep 29, 2023
1 parent 2f4ad37 commit 4026d5a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion platform/reworkd_platform/web/api/agent/model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,16 @@ def get_base_and_headers(
settings_: Settings, model_settings: ModelSettings, user: UserBase
) -> Tuple[str, Optional[Dict[str, str]], bool]:
use_helicone = settings_.helicone_enabled and not model_settings.custom_api_key
base = settings_.helicone_api_base if use_helicone else settings_.openai_api_base
base = (
settings_.helicone_api_base
if use_helicone
else (
"https://api.openai.com/v1"
if model_settings.custom_api_key
else settings_.openai_api_base
)
)

headers = (
{
"Helicone-Auth": f"Bearer {settings_.helicone_api_key}",
Expand Down

0 comments on commit 4026d5a

Please sign in to comment.