Stream Messages
client.Beta.Chat.Stream(ctx, sessionID, params) (*BetaChatStreamResponse, error)
POST/api/v1/chat/{session_id}/messages/stream
Stream agent events for a chat turn as Server-Sent Events.
Stream Messages
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/llamacloud-prod-go"
"github.com/stainless-sdks/llamacloud-prod-go/option"
)
func main() {
client := llamacloudprod.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Beta.Chat.Stream(
context.TODO(),
"session_id",
llamacloudprod.BetaChatStreamParams{
IndexIDs: []string{"idx-abc123", "idx-def456"},
Prompt: "What were the main findings in Q3?",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{}Returns Examples
{}