mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-23 20:26:28 +00:00
fix: headers parameter to default to None rather than empty dict (#10728)
Signed-off-by: Teryl Taylor <terylt@ibm.com> Co-authored-by: Teryl Taylor <terylt@ibm.com>
This commit is contained in:
@@ -245,7 +245,7 @@ class BaseLLMHTTPHandler:
|
||||
stream: Optional[bool] = False,
|
||||
fake_stream: bool = False,
|
||||
api_key: Optional[str] = None,
|
||||
headers: Optional[dict] = {},
|
||||
headers: Optional[Dict[str, Any]] = None,
|
||||
client: Optional[Union[HTTPHandler, AsyncHTTPHandler]] = None,
|
||||
provider_config: Optional[BaseConfig] = None,
|
||||
):
|
||||
@@ -680,7 +680,7 @@ class BaseLLMHTTPHandler:
|
||||
api_key: Optional[str] = None,
|
||||
client: Optional[Union[HTTPHandler, AsyncHTTPHandler]] = None,
|
||||
aembedding: bool = False,
|
||||
headers={},
|
||||
headers: Optional[Dict[str, Any]] = None,
|
||||
) -> EmbeddingResponse:
|
||||
provider_config = ProviderConfigManager.get_provider_embedding_config(
|
||||
model=model, provider=litellm.LlmProviders(custom_llm_provider)
|
||||
@@ -688,7 +688,7 @@ class BaseLLMHTTPHandler:
|
||||
# get config from model, custom llm provider
|
||||
headers = provider_config.validate_environment(
|
||||
api_key=api_key,
|
||||
headers=headers,
|
||||
headers=headers or {},
|
||||
model=model,
|
||||
messages=[],
|
||||
optional_params=optional_params,
|
||||
@@ -821,7 +821,7 @@ class BaseLLMHTTPHandler:
|
||||
timeout: Optional[Union[float, httpx.Timeout]],
|
||||
model_response: RerankResponse,
|
||||
_is_async: bool = False,
|
||||
headers: dict = {},
|
||||
headers: Optional[Dict[str, Any]] = None,
|
||||
api_key: Optional[str] = None,
|
||||
api_base: Optional[str] = None,
|
||||
client: Optional[Union[HTTPHandler, AsyncHTTPHandler]] = None,
|
||||
@@ -829,7 +829,7 @@ class BaseLLMHTTPHandler:
|
||||
# get config from model, custom llm provider
|
||||
headers = provider_config.validate_environment(
|
||||
api_key=api_key,
|
||||
headers=headers,
|
||||
headers=headers or {},
|
||||
model=model,
|
||||
)
|
||||
|
||||
@@ -951,7 +951,7 @@ class BaseLLMHTTPHandler:
|
||||
custom_llm_provider: str,
|
||||
client: Optional[Union[HTTPHandler, AsyncHTTPHandler]] = None,
|
||||
atranscription: bool = False,
|
||||
headers: dict = {},
|
||||
headers: Optional[Dict[str, Any]] = None,
|
||||
provider_config: Optional[BaseAudioTranscriptionConfig] = None,
|
||||
) -> TranscriptionResponse:
|
||||
if provider_config is None:
|
||||
@@ -960,7 +960,7 @@ class BaseLLMHTTPHandler:
|
||||
)
|
||||
headers = provider_config.validate_environment(
|
||||
api_key=api_key,
|
||||
headers=headers,
|
||||
headers=headers or {},
|
||||
model=model,
|
||||
messages=[],
|
||||
optional_params=optional_params,
|
||||
|
||||
Reference in New Issue
Block a user