Skip to content

Commit

Permalink
add extra headers option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Seabock (Centific Technologies Inc) committed Jul 10, 2024
1 parent d3e4f62 commit 21f0448
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
1 change: 1 addition & 0 deletions backend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 21f0448

Please sign in to comment.