Skip to content

Commit

Permalink
Add default_header support (#5249)
Browse files Browse the repository at this point in the history
Closes #5163
---------

Co-authored-by: Eric Zhu <[email protected]>
  • Loading branch information
nour-bouzid and ekzhu authored Feb 1, 2025
1 parent 088a50f commit 0bf786f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ class OpenAIChatCompletionClient(BaseOpenAIChatCompletionClient, Component[OpenA
temperature (optional, float):
top_p (optional, float):
user (optional, str):
default_headers (optional, dict[str, str]): Custom headers; useful for authentication or other custom requirements.
To use this client, you must install the `openai` extension:
Expand Down Expand Up @@ -1116,6 +1117,8 @@ class AzureOpenAIChatCompletionClient(
temperature (optional, float):
top_p (optional, float):
user (optional, str):
default_headers (optional, dict[str, str]): Custom headers; useful for authentication or other custom requirements.
To use this client, you must install the `azure` and `openai` extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class BaseOpenAIClientConfiguration(CreateArguments, total=False):
model_capabilities: ModelCapabilities # type: ignore
model_info: ModelInfo
"""What functionality the model supports, determined by default from model name but is overriden if value passed."""
default_headers: Dict[str, str] | None


# See OpenAI docs for explanation of these parameters
Expand Down Expand Up @@ -74,6 +75,7 @@ class BaseOpenAIClientConfigurationConfigModel(CreateArgumentsConfigModel):
max_retries: int | None = None
model_capabilities: ModelCapabilities | None = None # type: ignore
model_info: ModelInfo | None = None
default_headers: Dict[str, str] | None = None


# See OpenAI docs for explanation of these parameters
Expand Down

0 comments on commit 0bf786f

Please sign in to comment.