You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rolest.ConversationRole`json:"role" doc:"Role of the message author"`
14
29
}
15
30
16
31
// StatusResponse represents the server status
17
32
typeStatusResponsestruct {
18
33
Bodystruct {
19
-
Statusstring`json:"status" example:"running" doc:"Current server status"`
34
+
StatusAgentStatus`json:"status" doc:"Current agent status. 'running' means that the agent is processing a message, 'stable' means that the agent is idle and waiting for input."`
20
35
}
21
36
}
22
37
23
38
// MessagesResponse represents the list of messages
24
39
typeMessagesResponsestruct {
25
40
Bodystruct {
26
-
Messages []Message`json:"messages" doc:"List of messages"`
41
+
Messages []Message`json:"messages" nullable:"false" doc:"List of messages"`
TypeMessageType`json:"type" doc:"A 'user' type message will be logged as a user message in the conversation history and submitted to the agent. AgentAPI will wait until the agent starts carrying out the task described in the message before responding. A 'raw' type message will be written directly to the agent's terminal session as keystrokes and will not be saved in the conversation history. 'raw' messages are useful for sending escape sequences to the terminal."`
33
48
}
34
49
35
50
// MessageRequest represents a request to create a new message
36
51
typeMessageRequeststruct {
37
-
BodyMessageRequestBody`json:"body"`
52
+
BodyMessageRequestBody`json:"body" doc:"Message content and type"`
38
53
}
39
54
40
55
// MessageResponse represents a newly created message
41
56
typeMessageResponsestruct {
42
57
Bodystruct {
43
-
Okbool`json:"ok" doc:"Whether the message was sent successfully"`
58
+
Okbool`json:"ok" doc:"Indicates whether the message was sent successfully. For messages of type 'user', success means detecting that the agent began executing the task described. For messages of type 'raw', success means the keystrokes were sent to the terminal."`
o.Description="Send a message to the agent. For messages of type 'user', the agent's status must be 'stable' for the operation to complete successfully. Otherwise, this endpoint will return an error."
113
+
})
108
114
109
115
// GET /events endpoint
110
116
sse.Register(s.api, huma.Operation{
111
117
OperationID: "subscribeEvents",
112
118
Method: http.MethodGet,
113
119
Path: "/events",
114
120
Summary: "Subscribe to events",
121
+
Description: "The events are sent as Server-Sent Events (SSE). Initially, the endpoint returns a list of events needed to reconstruct the current state of the conversation and the agent's status. After that, it only returns events that have occurred since the last event was sent.",
115
122
}, map[string]any{
116
123
// Mapping of event type name to Go struct for that event.
0 commit comments