Skip to content

RemoteA2aAgent - SendMessage issue [no attribute 'params' ] #2918

@pretbc

Description

@pretbc

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Describe the bug
There is a bug in the implementation

      a2a_request = A2AMessage(
          message_id=str(uuid.uuid4()),
          parts=message_parts,
          role="user",
          context_id=context_id,
      )

    logger.debug(build_a2a_request_log(a2a_request))

A2A type

class Message(A2ABaseModel):
    """
    Represents a single message in the conversation between a user and an agent.
    """

    context_id: str | None = None
    """
    The context ID for this message, used to group related interactions.
    """
    extensions: list[str] | None = None
    """
    The URIs of extensions that are relevant to this message.
    """
    kind: Literal['message'] = 'message'
    """
    The type of this object, used as a discriminator. Always 'message' for a Message.
    """
    message_id: str
    """
    A unique identifier for the message, typically a UUID, generated by the sender.
    """
    metadata: dict[str, Any] | None = None
    """
    Optional metadata for extensions. The key is an extension-specific identifier.
    """
    parts: list[Part]
    """
    An array of content parts that form the message body. A message can be
    composed of multiple parts of different types (e.g., text and files).
    """
    reference_task_ids: list[str] | None = None
    """
    A list of other task IDs that this message references for additional context.
    """
    role: Role
    """
    Identifies the sender of the message. `user` for the client, `agent` for the service.
    """
    task_id: str | None = None
    """
    The ID of the task this message is part of. Can be omitted for the first message of a new task.
    """

so when You call

site-packages/google/adk/a2a/logs/log_utils.py", line 128, in build_a2a_request_log
    if req.params.message.parts:
       ^^^^^^^^^^
  File "/Users/pretbc/Workspace/mags-demo/.venv/lib/python3.13/site-packages/pydantic/main.py", line 991, in __getattr__
    raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'Message' object has no attribute 'params'. Did you mean: 'parts'?

PARAMS are in

class SendMessageRequest(A2ABaseModel):
    """
    Represents a JSON-RPC request for the `message/send` method.
    """

    id: str | int
    """
    The identifier for this request.
    """
    jsonrpc: Literal['2.0'] = '2.0'
    """
    The version of the JSON-RPC protocol. MUST be exactly "2.0".
    """
    method: Literal['message/send'] = 'message/send'
    """
    The method name. Must be 'message/send'.
    """
    params: MessageSendParams
    """
    The parameters for sending a message.
    """

To Reproduce
Steps to reproduce the behavior:

  1. Install latest googl-adk 1.14.0
  2. RunRemoteA2aAgent
  3. Send something
  4. See error above

Expected behavior
Msssage sent

Desktop (please complete the following information):

  • OS:MacOS
  • Python version(python -V): 3.13
  • ADK version(pip show google-adk):1.14.0

Model Information:
For example, which model is being used.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

mcp[Component] Issues about MCP support

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions