Skip to content
Ona Docs

SendToAgentExecution

client.Agents.SendToExecution(ctx, body) (*AgentSendToExecutionResponse, error)
POST/gitpod.v1.AgentService/SendToAgentExecution

Sends user input to an active agent run.

This method is used to provide interactive or conversation-based input to an agent. The agent can respond with output blocks containing text, file changes, or tool usage requests.

Examples

  • Send a text message to an agent:

    agentExecutionId: "6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"
    userInput:
      text:
        content: "Generate a report based on the latest logs."
ParametersExpand Collapse
body AgentSendToExecutionParams
AgentExecutionID param.Field[string]Optional
formatuuid
AgentMessage param.Field[AgentMessage]Optional

AgentMessage is a message sent between agents (e.g. from a parent agent to a child agent execution, or vice versa).

UserInput param.Field[UserInputBlock]Optional
WakeEvent param.Field[WakeEvent]Optional

WakeEvent is sent by the backend to wake an agent when a registered interest fires. Delivered via SendToAgentExecution as a new oneof variant.

ReturnsExpand Collapse
type AgentSendToExecutionResponse interface{…}

SendToAgentExecution

package main

import (
  "context"
  "fmt"

  "github.com/gitpod-io/gitpod-sdk-go"
  "github.com/gitpod-io/gitpod-sdk-go/option"
)

func main() {
  client := gitpod.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  response, err := client.Agents.SendToExecution(context.TODO(), gitpod.AgentSendToExecutionParams{
    AgentExecutionID: gitpod.F("6fa1a3c7-fbb7-49d1-ba56-1890dc7c4c35"),
    UserInput: gitpod.F(gitpod.UserInputBlockParam{
      Text: gitpod.F(gitpod.UserInputBlockTextParam{
        Content: gitpod.F("Generate a report based on the latest logs."),
      }),
    }),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response)
}
{}
Returns Examples
{}