Trasmetti in streaming gli eventi del thread di sessione
GET/v1/sessions/{session_id}/threads/{thread_id}/stream
Trasmetti in streaming gli eventi del thread di sessione
Parameters
Returns
Trasmetti in streaming gli eventi del thread di sessione
package main
import (
"context"
"fmt"
"github.com/anthropics/anthropic-sdk-go"
"github.com/anthropics/anthropic-sdk-go/option"
)
func main() {
client := anthropic.NewClient(
option.WithAPIKey("my-anthropic-api-key"),
)
stream := client.Beta.Sessions.Threads.Events.StreamEvents(
context.TODO(),
"sthr_011CZkZVWa6oJjw1rgXZpnBt",
anthropic.BetaSessionThreadEventStreamParams{
SessionID: "sesn_011CZkZAtmR3yMPDzynEDxu7",
},
)
for stream.Next() {
fmt.Printf("%+v\n", stream.Current())
}
err := stream.Err()
if err != nil {
panic(err.Error())
}
}Response 200
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}Returns Examples
Response 200
{
"id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
"content": [
{
"text": "Where is my order #1234?",
"type": "text"
}
],
"type": "user.message",
"processed_at": "2026-03-15T10:00:00Z"
}