sendStreamingMessage
Configures the behavior of the mocking server to handle message/stream requests.
This method simulates the behavior of the A2A protocol's message/stream endpoint, which allows sending messages with real-time streaming responses via Server-Sent Events (SSE). It allows defining how the server should respond to streaming message requests by chaining a response configuration using the responds method of the returned SendTaskStreamingBuildingStep.
Example usage:
// Configure the mock server to respond with streaming task updates
a2aServer.sendStreamingMessage() responds {
responseFlow = flow {
emit(
taskStatusUpdateEvent {
id = "task_12345"
status {
state = "working"
timestamp = System.currentTimeMillis()
}
final = false
}
)
delay(1000)
emit(
taskStatusUpdateEvent {
id = "task_12345"
status {
state = "completed"
timestamp = System.currentTimeMillis()
}
final = true
}
)
}
}Content copied to clipboard
Return
An instance of SendTaskStreamingBuildingStep to define the response behavior for message/stream requests.
Parameters
name
An optional identifier for the configured request.