98896eb2aa
A streaming tool used to only talk to the model: every value it yielded came back as a FunctionResponse. Therefore it costs model context and could derail the model's reasoning. An Event with message yielded by a streaming tool is now addressed to the user instead. It is enqueued on the invocation's event queue, so the runner appends it to the session and streams it to the client, and it is never sent over the live model connection. Plain values are still sent to the model as FunctionResponse. A tool can mix and match any number of each, in any order. Runner's run_live also now initializes the invocation's event queue and merges it with the live agent's own event stream. Without a queue, anything running under the live agent that enqueues an event -- a streaming tool, or a node -- fails with "_event_queue is not set". Co-authored-by: Liang Wu <wuliang@google.com> PiperOrigin-RevId: 968533249