mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-26 06:03:19 +00:00
fix(sap): use Mapping return type for merge_sap_request_headers
LIT001 strict budget failed on dict[str, str] return annotation after rebase Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
cc94fe797c
commit
24d781a4f0
1 changed files with 5 additions and 4 deletions
|
|
@ -1,21 +1,22 @@
|
|||
from typing import Mapping
|
||||
|
||||
|
||||
_SAP_RESERVED_HEADERS = frozenset(
|
||||
{
|
||||
(
|
||||
"authorization",
|
||||
"ai-resource-group",
|
||||
"content-type",
|
||||
"ai-client-type",
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def merge_sap_request_headers(
|
||||
provider_headers: Mapping[str, str],
|
||||
caller_headers: Mapping[str, str] | None,
|
||||
) -> dict[str, str]:
|
||||
) -> Mapping[str, str]:
|
||||
if not caller_headers:
|
||||
return dict(provider_headers)
|
||||
return provider_headers
|
||||
|
||||
safe_caller_headers = {
|
||||
key: value for key, value in caller_headers.items() if key.lower() not in _SAP_RESERVED_HEADERS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue