mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix: close final A2A review gaps
This commit is contained in:
parent
4556ffc86d
commit
22952e4deb
3 changed files with 31 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ _AGENT_ONLY_PARAMS: Final = frozenset(
|
|||
"agent_id",
|
||||
"agent_card_params",
|
||||
A2A_USER_API_KEY_HASH_PARAM,
|
||||
"databricks_oauth",
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -858,6 +858,16 @@ async def invoke_agent_a2a(
|
|||
response=response,
|
||||
)
|
||||
post_call_succeeded = True
|
||||
except HTTPException as e:
|
||||
try:
|
||||
await proxy_logging_obj.post_call_failure_hook(
|
||||
user_api_key_dict=user_api_key_dict,
|
||||
original_exception=e,
|
||||
request_data=data,
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
raise
|
||||
finally:
|
||||
_enqueue_fn: Final = getattr(logging_obj, "_enqueue_deferred_logging", None)
|
||||
if _enqueue_fn is not None:
|
||||
|
|
|
|||
|
|
@ -275,6 +275,26 @@ def test_build_completion_params_keeps_bridge_routing_fields():
|
|||
assert params["stream"] is True
|
||||
|
||||
|
||||
def test_build_completion_params_drops_proxy_only_databricks_oauth():
|
||||
from litellm.a2a_protocol.litellm_completion_bridge.handler import (
|
||||
A2ACompletionBridgeHandler,
|
||||
)
|
||||
|
||||
params = A2ACompletionBridgeHandler._build_completion_params(
|
||||
params={"message": {"role": "user", "parts": []}},
|
||||
litellm_params={
|
||||
"custom_llm_provider": "databricks",
|
||||
"model": "agent",
|
||||
"databricks_oauth": {"client_id": "id"},
|
||||
},
|
||||
api_base="https://configured.example",
|
||||
agent_extra_headers=None,
|
||||
stream=False,
|
||||
)
|
||||
|
||||
assert "databricks_oauth" not in params
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_handle_streaming_accumulates_logprobs_and_provider_metadata():
|
||||
from litellm.a2a_protocol.litellm_completion_bridge.handler import (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue