Class RequestConverter

java.lang.Object
com.google.adk.a2a.converters.RequestConverter

public final class RequestConverter extends Object
rfe Converter for A2A Messages to ADK Events. This is used on the A2A service side to convert incoming A2A requests to ADK Events.

**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not use in production code.

  • Method Details

    • convertA2aMessageToAdkEvent

      public static Optional<Event> convertA2aMessageToAdkEvent(io.a2a.spec.Message message, String invocationId)
      Convert an A2A Message to an ADK Event. This is used when the A2A service receives a request and needs to process it with ADK.
      Parameters:
      message - The A2A message to convert.
      invocationId - The invocation ID for the event.
      Returns:
      Optional containing the converted ADK Event, or empty if conversion fails.
    • convertAggregatedA2aMessageToAdkEvents

      public static com.google.common.collect.ImmutableList<Event> convertAggregatedA2aMessageToAdkEvents(io.a2a.spec.Message message, String invocationId)
      Convert an aggregated A2A Message to multiple ADK Events. This reconstructs the original event sequence from an aggregated message.
      Parameters:
      message - The aggregated A2A message to convert.
      invocationId - The invocation ID for the events.
      Returns:
      List of ADK Events representing the conversation history.