mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(bedrock): build response field paths as an immutable sequence to satisfy the type discipline gate
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
20e92d1e68
commit
418e8ca5e8
4 changed files with 5 additions and 4 deletions
|
|
@ -1618,7 +1618,7 @@ class AmazonConverseConfig(BaseConfig):
|
|||
if additional_request_params:
|
||||
data["additionalModelRequestFields"] = additional_request_params
|
||||
if "thinking" in additional_request_params:
|
||||
data["additionalModelResponseFieldPaths"] = ["/usage/output_tokens_details"]
|
||||
data["additionalModelResponseFieldPaths"] = ("/usage/output_tokens_details",)
|
||||
if system_content_blocks:
|
||||
data["system"] = system_content_blocks
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import json
|
||||
from collections.abc import Sequence
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, Any, Final, Literal
|
||||
|
||||
|
|
@ -396,7 +397,7 @@ class OutputConfigBlock(TypedDict, total=False):
|
|||
|
||||
class CommonRequestObject(TypedDict, total=False): # common request object across sync + async flows
|
||||
additionalModelRequestFields: dict
|
||||
additionalModelResponseFieldPaths: list[str]
|
||||
additionalModelResponseFieldPaths: Sequence[str]
|
||||
inferenceConfig: InferenceConfig
|
||||
system: list[SystemContentBlock]
|
||||
toolConfig: ToolConfigBlock
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ def test_thinking_request_adds_output_tokens_details_response_path():
|
|||
headers={},
|
||||
)
|
||||
|
||||
assert result["additionalModelResponseFieldPaths"] == ["/usage/output_tokens_details"]
|
||||
assert result["additionalModelResponseFieldPaths"] == ("/usage/output_tokens_details",)
|
||||
|
||||
|
||||
def test_request_without_thinking_omits_response_field_paths():
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"LIT001": {
|
||||
"limit": 22805
|
||||
"limit": 22804
|
||||
},
|
||||
"LIT002": {
|
||||
"limit": 26873
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue