Convert Session To Invocation.

PiperOrigin-RevId: 758356942
This commit is contained in:
Ankur Sharma
2025-05-13 13:39:17 -07:00
committed by Copybara-Service
parent 4188673b0f
commit 82b8e304ec
2 changed files with 93 additions and 4 deletions

View File

@@ -13,7 +13,7 @@
# limitations under the License.
from typing import Any, Optional
from typing import Any, Optional, Tuple
from google.genai import types as genai_types
from pydantic import BaseModel
@@ -26,9 +26,16 @@ class IntermediateData(BaseModel):
tool_uses: list[genai_types.FunctionCall]
"""Tool use trajectory in chronological order."""
intermediate_responses: list[genai_types.Part]
intermediate_responses: list[Tuple[str, list[genai_types.Part]]]
"""Intermediate responses generated by sub-agents to convey progress or status
in a multi-agent system, distinct from the final response."""
in a multi-agent system, distinct from the final response.
This is expressed as a Tuple of:
- Author: Usually the sub-agent name that generated the intermediate
response.
- A list of Parts that comprise of the response.
"""
class Invocation(BaseModel):