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 OpenCode chat session backed by a Daytona 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)
Terminates the active Daytona runtime (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 OpenCode generation for this Daytona-backed 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)
-
createStreamToken
CompletableFuture<ChatCreateStreamTokenResponse> createStreamToken(String id)
Returns a short-lived token that allows browser clients to connect directly to the agent chat SSE stream without exposing the underlying org API key.
-
createStreamToken
CompletableFuture<ChatCreateStreamTokenResponse> createStreamToken(String id, ChatCreateStreamTokenParams params, RequestOptions requestOptions)
-
createStreamToken
CompletableFuture<ChatCreateStreamTokenResponse> createStreamToken(String id, ChatCreateStreamTokenParams params)
-
createStreamToken
abstract CompletableFuture<ChatCreateStreamTokenResponse> createStreamToken(ChatCreateStreamTokenParams params, RequestOptions requestOptions)
-
createStreamToken
CompletableFuture<ChatCreateStreamTokenResponse> createStreamToken(ChatCreateStreamTokenParams params)
-
createStreamToken
CompletableFuture<ChatCreateStreamTokenResponse> createStreamToken(String id, RequestOptions requestOptions)
-
replyToQuestion
CompletableFuture<Void> replyToQuestion(String requestId, ChatReplyToQuestionParams params)
Answers a pending OpenCode question for the Daytona-backed chat session and resumes or recovers the runtime if needed.
-
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 from a Daytona-backed chat runtime 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 to a Daytona-backed chat runtime and returns the complete response as a single JSON body. Blocks until the assistant 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 OpenCode SSE events for this Daytona-backed chat runtime. Supports replay from buffered events using Last-Event-ID and transparently reconnects stopped or archived runtimes. Accepts either Bearer token auth or a short-lived stream token via query parameter. When both are provided, Bearer auth takes precedence.
-
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)
-
-
-
-