From 21f0448389b43ec85128a7e1d70fe0f38333d0d4 Mon Sep 17 00:00:00 2001 From: "Ian Seabock (Centific Technologies Inc)" Date: Wed, 10 Jul 2024 10:47:38 -0700 Subject: [PATCH] add extra headers option --- app.py | 2 ++ backend/settings.py | 1 + 2 files changed, 3 insertions(+) diff --git a/app.py b/app.py index aab516842f..2558030e18 100644 --- a/app.py +++ b/app.py @@ -230,6 +230,8 @@ def prepare_model_args(request_body, request_headers): ] } + model_args["extra_headers"] = {"is_external": "false", "chatgpt_key": app_settings.azure_openai.chatgpt_key, "chatgpt_url": "https://wed-aiq-aoai-ncus.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-05-01-preview"} + model_args_clean = copy.deepcopy(model_args) if model_args_clean.get("extra_body"): secret_params = [ diff --git a/backend/settings.py b/backend/settings.py index 11afc26254..d9f6fa4396 100644 --- a/backend/settings.py +++ b/backend/settings.py @@ -122,6 +122,7 @@ class _AzureOpenAISettings(BaseSettings): embedding_endpoint: Optional[str] = None embedding_key: Optional[str] = None embedding_name: Optional[str] = None + chatgpt_key: Optional[str] = None @field_validator('tools', mode='before') @classmethod