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
16 lines
595 B
Python
16 lines
595 B
Python
# Copyright 2026 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
from . import agent
|