diff --git a/litellm/llms/a2a/chat/transformation.py b/litellm/llms/a2a/chat/transformation.py index 613ae4e16bb..47705a1f832 100644 --- a/litellm/llms/a2a/chat/transformation.py +++ b/litellm/llms/a2a/chat/transformation.py @@ -55,9 +55,7 @@ class A2AConfig(BaseConfig): agent_name = model.split("/", 1)[1] if "/" in model else None # Only lookup if agent name exists and some config is missing - if not agent_name or ( - api_base is not None and api_key is not None and headers is not None - ): + if not agent_name or (api_base is not None and api_key is not None and headers is not None): return api_base, api_key, headers # Try registry lookup (only available in proxy context) @@ -84,10 +82,7 @@ class A2AConfig(BaseConfig): # Merge other litellm_params (timeout, max_retries, etc.) for key, value in agent.litellm_params.items(): - if ( - key not in ["api_key", "api_base", "headers", "model"] - and key not in optional_params - ): + if key not in ["api_key", "api_base", "headers", "model"] and key not in optional_params: optional_params[key] = value except ImportError: pass # Registry not available (not running in proxy context) diff --git a/litellm/llms/a2a/common_utils.py b/litellm/llms/a2a/common_utils.py index c25617abe85..def408d32f0 100644 --- a/litellm/llms/a2a/common_utils.py +++ b/litellm/llms/a2a/common_utils.py @@ -62,9 +62,7 @@ def convert_messages_to_prompt(messages: List[AllMessageValues]) -> str: return "\n".join(conversation_parts) -def extract_text_from_a2a_message( - message: Dict[str, Any], depth: int = 0, max_depth: int = 10 -) -> str: +def extract_text_from_a2a_message(message: Dict[str, Any], depth: int = 0, max_depth: int = 10) -> str: """ Extract text content from A2A message parts. @@ -102,9 +100,7 @@ def extract_text_from_a2a_message( return " ".join(text_parts) -def extract_text_from_a2a_response( - response_dict: Dict[str, Any], max_depth: int = 10 -) -> str: +def extract_text_from_a2a_response(response_dict: Dict[str, Any], max_depth: int = 10) -> str: """ Extract text content from A2A response result. @@ -145,16 +141,12 @@ def extract_text_from_a2a_response( if isinstance(status, dict): status_message = status.get("message") if status_message: - return extract_text_from_a2a_message( - status_message, depth=0, max_depth=max_depth - ) + return extract_text_from_a2a_message(status_message, depth=0, max_depth=max_depth) # Handle task result with artifacts (plural, array) artifacts = result.get("artifacts", []) if artifacts and len(artifacts) > 0: first_artifact = artifacts[0] - return extract_text_from_a2a_message( - first_artifact, depth=0, max_depth=max_depth - ) + return extract_text_from_a2a_message(first_artifact, depth=0, max_depth=max_depth) return ""