Interface ChatService
-
- All Implemented Interfaces:
public interface ChatServiceCreate, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceChatService.WithRawResponseA view of ChatService that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract ChatService.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
withOptions
abstract ChatService withOptions(Consumer<ClientOptions.Builder> modifier)
Returns a view of this service with the given option modifications applied.
The original service is not modified.
-
files
abstract FileService files()
Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
-
create
ChatCreateResponse create()
Creates a persistent chat session backed by a Daytona or Vercel runtime. Session state is retained and can be resumed or recovered across requests.
-
create
abstract ChatCreateResponse create(ChatCreateParams params, RequestOptions requestOptions)
-
create
ChatCreateResponse create(ChatCreateParams params)
-
create
ChatCreateResponse create(RequestOptions requestOptions)
-
delete
ChatDeleteResponse delete(String id)
Snapshots and terminates the active sandbox (if any), then marks the chat as ended.
-
delete
ChatDeleteResponse delete(String id, ChatDeleteParams params, RequestOptions requestOptions)
-
delete
ChatDeleteResponse delete(String id, ChatDeleteParams params)
-
delete
abstract ChatDeleteResponse delete(ChatDeleteParams params, RequestOptions requestOptions)
-
delete
ChatDeleteResponse delete(ChatDeleteParams params)
-
delete
ChatDeleteResponse delete(String id, RequestOptions requestOptions)
-
cancel
ChatCancelResponse cancel(String id)
Aborts the active generation for this chat session.
-
cancel
ChatCancelResponse cancel(String id, ChatCancelParams params, RequestOptions requestOptions)
-
cancel
ChatCancelResponse cancel(String id, ChatCancelParams params)
-
cancel
abstract ChatCancelResponse cancel(ChatCancelParams params, RequestOptions requestOptions)
-
cancel
ChatCancelResponse cancel(ChatCancelParams params)
-
cancel
ChatCancelResponse cancel(String id, RequestOptions requestOptions)
-
replyToQuestion
Unit replyToQuestion(String requestId, ChatReplyToQuestionParams params)
Answers a pending runtime question for the chat session bound to this agent chat.
-
replyToQuestion
Unit replyToQuestion(String requestId, ChatReplyToQuestionParams params, RequestOptions requestOptions)
-
replyToQuestion
Unit replyToQuestion(ChatReplyToQuestionParams params)
-
replyToQuestion
abstract Unit replyToQuestion(ChatReplyToQuestionParams params, RequestOptions requestOptions)
-
respondStreaming
@MustBeClosed() StreamResponse<String> respondStreaming(String id)
Streams a single assistant turn as normalized SSE events with stable turn, message, and part IDs. Emits events:
turn.started,turn.status,message.created,message.part.updated,message.completed,session.usage,turn.completed.When to use this endpoint: Recommended for building custom chat UIs that need real-time streaming progress. This is the primary streaming endpoint for new integrations.
Alternatives:
POST /chat/:id/message— synchronous, returns complete response as JSON (best for server-to-server)
-
respondStreaming
@MustBeClosed() StreamResponse<String> respondStreaming(String id, ChatRespondParams params, RequestOptions requestOptions)
-
respondStreaming
@MustBeClosed() StreamResponse<String> respondStreaming(String id, ChatRespondParams params)
-
respondStreaming
@MustBeClosed() abstract StreamResponse<String> respondStreaming(ChatRespondParams params, RequestOptions requestOptions)
-
respondStreaming
@MustBeClosed() StreamResponse<String> respondStreaming(ChatRespondParams params)
-
respondStreaming
@MustBeClosed() StreamResponse<String> respondStreaming(String id, RequestOptions requestOptions)
-
sendMessage
Unit sendMessage(String id)
Sends a message and returns the complete response as a single JSON body. Blocks until the agent turn completes.
When to use this endpoint: Best for server-to-server integrations, background processing, or any context where you want the full response in one call without managing an SSE stream.
Alternatives:
POST /chat/:id/respond— streaming SSE with normalized events (recommended for custom chat UIs)
-
sendMessage
Unit sendMessage(String id, ChatSendMessageParams params, RequestOptions requestOptions)
-
sendMessage
Unit sendMessage(String id, ChatSendMessageParams params)
-
sendMessage
abstract Unit sendMessage(ChatSendMessageParams params, RequestOptions requestOptions)
-
sendMessage
Unit sendMessage(ChatSendMessageParams params)
-
sendMessage
Unit sendMessage(String id, RequestOptions requestOptions)
-
streamStreaming
@MustBeClosed() StreamResponse<String> streamStreaming(String id)
Relays runtime SSE events for this chat. Supports replay from buffered events using Last-Event-ID.
-
streamStreaming
@MustBeClosed() StreamResponse<String> streamStreaming(String id, ChatStreamParams params, RequestOptions requestOptions)
-
streamStreaming
@MustBeClosed() StreamResponse<String> streamStreaming(String id, ChatStreamParams params)
-
streamStreaming
@MustBeClosed() abstract StreamResponse<String> streamStreaming(ChatStreamParams params, RequestOptions requestOptions)
-
streamStreaming
@MustBeClosed() StreamResponse<String> streamStreaming(ChatStreamParams params)
-
streamStreaming
@MustBeClosed() StreamResponse<String> streamStreaming(String id, RequestOptions requestOptions)
-
-
-
-