Stream Messages
JsonValue beta().chat().stream(ChatStreamParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/api/v1/chat/{session_id}/messages/stream
Stream agent events for a chat turn as Server-Sent Events.
Stream Messages
package com.llamacloud_prod.api.example;
import com.llamacloud_prod.api.client.LlamaCloudClient;
import com.llamacloud_prod.api.client.okhttp.LlamaCloudOkHttpClient;
import com.llamacloud_prod.api.models.beta.chat.ChatStreamParams;
import com.llamacloud_prod.api.models.beta.chat.ChatStreamResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();
ChatStreamParams params = ChatStreamParams.builder()
.sessionId("session_id")
.addIndexId("idx-abc123")
.addIndexId("idx-def456")
.prompt("What were the main findings in Q3?")
.build();
ChatStreamResponse response = client.beta().chat().stream(params);
}
}{}Returns Examples
{}