fix(proxy): resolve 'multiple values for keyword argument' in batch cancel and file retrieve

- batch_endpoints.py: Pop batch_id from data before creating CancelBatchRequest
  to avoid duplicate batch_id when data already contains it from earlier cast

- files_endpoints.py: Pop file_id from data before calling afile_retrieve
  to avoid duplicate file_id when data was initialized with {"file_id": file_id}

- test_claude_agent_sdk.py: Disable bedrock-nova-premier test as it requires
  an inference profile for on-demand throughput (AWS limitation)

Fixes: e2e_openai_endpoints tests (test_batches_operations, test_file_operations)
Fixes: proxy_e2e_anthropic_messages_tests (nova-premier model skip)
This commit is contained in:
shin-bot-litellm
2026-01-31 21:26:29 +00:00
parent 586b041837
commit dff7f83e7c
3 changed files with 9 additions and 1 deletions
@@ -760,6 +760,9 @@ async def cancel_batch(
custom_llm_provider = (
provider or data.pop("custom_llm_provider", None) or "openai"
)
# Extract batch_id from data to avoid "multiple values for keyword argument" error
# data was cast from CancelBatchRequest which already contains batch_id
data.pop("batch_id", None)
_cancel_batch_data = CancelBatchRequest(batch_id=batch_id, **data)
response = await litellm.acancel_batch(
custom_llm_provider=custom_llm_provider, # type: ignore
@@ -904,6 +904,9 @@ async def get_file(
llm_router=llm_router,
)
else:
# Remove file_id from data to avoid "multiple values for keyword argument" error
# data was initialized with {"file_id": file_id}
data.pop("file_id", None)
response = await litellm.afile_retrieve(
custom_llm_provider=custom_llm_provider, file_id=file_id, **data # type: ignore
)
@@ -16,10 +16,12 @@ from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions
# Test models from proxy_config.yaml
# Note: bedrock-converse-claude-sonnet-4.5 removed temporarily as the Bedrock Converse API
# for Claude Sonnet 4.5 may not be available in all regions/accounts
# Note: bedrock-nova-premier requires an inference profile for on-demand throughput
# https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles.html
TEST_MODELS = [
("bedrock-claude-sonnet-4.5", "Bedrock Invoke API"),
# ("bedrock-converse-claude-sonnet-4.5", "Bedrock Converse API"), # Disabled: not yet available in CI
("bedrock-nova-premier", "AWS Nova Premier"),
# ("bedrock-nova-premier", "AWS Nova Premier"), # Disabled: requires inference profile for on-demand throughput
]