Interface ChatServiceAsync
-
- All Implemented Interfaces:
public interface ChatServiceAsyncCreate, 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 interfaceChatServiceAsync.WithRawResponseA view of ChatServiceAsync that provides access to raw HTTP responses for each method.
-
Method Summary
-
-
Method Detail
-
withRawResponse
abstract ChatServiceAsync.WithRawResponse withRawResponse()
Returns a view of this service that provides access to raw HTTP responses for each method.
-
withOptions
abstract ChatServiceAsync 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 FileServiceAsync files()
Create, manage, and execute AI agents with tool access, sandbox environments, and async run workflows
-
create
CompletableFuture<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 CompletableFuture<ChatCreateResponse> create(ChatCreateParams params, RequestOptions requestOptions)
-
create
CompletableFuture<ChatCreateResponse> create(ChatCreateParams params)
-
create
CompletableFuture<ChatCreateResponse> create(RequestOptions requestOptions)
-
delete
CompletableFuture<ChatDeleteResponse> delete(String id)
Snapshots and terminates the active sandbox (if any), then marks the chat as ended.
-
delete
CompletableFuture<ChatDeleteResponse> delete(String id, ChatDeleteParams params, RequestOptions requestOptions)
-
delete
CompletableFuture<ChatDeleteResponse> delete(String id, ChatDeleteParams params)
-
delete
abstract CompletableFuture<ChatDeleteResponse> delete(ChatDeleteParams params, RequestOptions requestOptions)
-
delete
CompletableFuture<ChatDeleteResponse> delete(ChatDeleteParams params)
-
delete
CompletableFuture<ChatDeleteResponse> delete(String id, RequestOptions requestOptions)
-
cancel
CompletableFuture<ChatCancelResponse> cancel(String id)
Aborts the active generation for this chat session.
-
cancel
CompletableFuture<ChatCancelResponse> cancel(String id, ChatCancelParams params, RequestOptions requestOptions)
-
cancel
CompletableFuture<ChatCancelResponse> cancel(String id, ChatCancelParams params)
-
cancel
abstract CompletableFuture<ChatCancelResponse> cancel(ChatCancelParams params, RequestOptions requestOptions)
-
cancel
CompletableFuture<ChatCancelResponse> cancel(ChatCancelParams params)
-
cancel
CompletableFuture<ChatCancelResponse> cancel(String id, RequestOptions requestOptions)
-
replyToQuestion
CompletableFuture<Void> replyToQuestion(String requestId, ChatReplyToQuestionParams params)
Answers a pending runtime question for the chat session bound to this agent chat.
-
replyToQuestion
CompletableFuture<Void> replyToQuestion(String requestId, ChatReplyToQuestionParams params, RequestOptions requestOptions)
-
replyToQuestion
CompletableFuture<Void> replyToQuestion(ChatReplyToQuestionParams params)
-
replyToQuestion
abstract CompletableFuture<Void> replyToQuestion(ChatReplyToQuestionParams params, RequestOptions requestOptions)
-
respondStreaming
AsyncStreamResponse<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
AsyncStreamResponse<String> respondStreaming(String id, ChatRespondParams params, RequestOptions requestOptions)
-
respondStreaming
AsyncStreamResponse<String> respondStreaming(String id, ChatRespondParams params)
-
respondStreaming
abstract AsyncStreamResponse<String> respondStreaming(ChatRespondParams params, RequestOptions requestOptions)
-
respondStreaming
AsyncStreamResponse<String> respondStreaming(ChatRespondParams params)
-
respondStreaming
AsyncStreamResponse<String> respondStreaming(String id, RequestOptions requestOptions)
-
sendMessage
CompletableFuture<Void> 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
CompletableFuture<Void> sendMessage(String id, ChatSendMessageParams params, RequestOptions requestOptions)
-
sendMessage
CompletableFuture<Void> sendMessage(String id, ChatSendMessageParams params)
-
sendMessage
abstract CompletableFuture<Void> sendMessage(ChatSendMessageParams params, RequestOptions requestOptions)
-
sendMessage
CompletableFuture<Void> sendMessage(ChatSendMessageParams params)
-
sendMessage
CompletableFuture<Void> sendMessage(String id, RequestOptions requestOptions)
-
streamStreaming
AsyncStreamResponse<String> streamStreaming(String id)
Relays runtime SSE events for this chat. Supports replay from buffered events using Last-Event-ID.
-
streamStreaming
AsyncStreamResponse<String> streamStreaming(String id, ChatStreamParams params, RequestOptions requestOptions)
-
streamStreaming
AsyncStreamResponse<String> streamStreaming(String id, ChatStreamParams params)
-
streamStreaming
abstract AsyncStreamResponse<String> streamStreaming(ChatStreamParams params, RequestOptions requestOptions)
-
streamStreaming
AsyncStreamResponse<String> streamStreaming(ChatStreamParams params)
-
streamStreaming
AsyncStreamResponse<String> streamStreaming(String id, RequestOptions requestOptions)
-
-
-
-