Class RunAgentInput

java.lang.Object
io.agentscope.core.agui.model.RunAgentInput

public class RunAgentInput extends Object
Input model for running an agent via the AG-UI protocol.

This class represents the complete input needed to invoke an agent, including messages, tools, context, state, and forwarded properties.

  • Constructor Details

    • RunAgentInput

      public RunAgentInput(String threadId, String runId, List<AguiMessage> messages, List<AguiTool> tools, List<AguiContext> context, Map<String,Object> state, Map<String,Object> forwardedProps)
      Creates a new RunAgentInput.
      Parameters:
      threadId - The thread ID for this conversation
      runId - The unique run ID
      messages - The conversation messages
      tools - Frontend-provided tools
      context - Additional context information
      state - Initial state to load
      forwardedProps - Additional properties to forward
  • Method Details

    • getThreadId

      public String getThreadId()
      Get the thread ID.
      Returns:
      The thread ID
    • getRunId

      public String getRunId()
      Get the run ID.
      Returns:
      The run ID
    • getMessages

      public List<AguiMessage> getMessages()
      Get the conversation messages.
      Returns:
      The messages as an immutable list
    • getTools

      public List<AguiTool> getTools()
      Get the frontend-provided tools.
      Returns:
      The tools as an immutable list
    • getContext

      public List<AguiContext> getContext()
      Get the context information.
      Returns:
      The context as an immutable list
    • getState

      public Map<String,Object> getState()
      Get the initial state.
      Returns:
      The state as an immutable map
    • getForwardedProps

      public Map<String,Object> getForwardedProps()
      Get the forwarded properties.
      Returns:
      The forwarded properties as an immutable map
    • getForwardedProp

      public Object getForwardedProp(String key)
      Get a specific forwarded property.
      Parameters:
      key - The property key
      Returns:
      The property value, or null if not present
    • getForwardedProp

      public Object getForwardedProp(String key, Object defaultValue)
      Get a specific forwarded property with a default value.
      Parameters:
      key - The property key
      defaultValue - The default value if not present
      Returns:
      The property value, or the default if not present
    • hasMessages

      public boolean hasMessages()
      Check if there are any messages.
      Returns:
      true if messages are present
    • hasTools

      public boolean hasTools()
      Check if there are any frontend tools.
      Returns:
      true if tools are present
    • hasContext

      public boolean hasContext()
      Check if there is any context.
      Returns:
      true if context is present
    • hasState

      public boolean hasState()
      Check if there is initial state.
      Returns:
      true if state is present
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static RunAgentInput.Builder builder()
      Creates a new builder for RunAgentInput.
      Returns:
      A new builder instance