chore: Adds docstring for LlmAgent.disallow_transfer_to_parent to clarify the expected behavior.

PiperOrigin-RevId: 758676926
This commit is contained in:
Wei Sun (Jack) 2025-05-14 07:36:15 -07:00 committed by Copybara-Service
parent 71bd808a14
commit b67182c50f

View File

@ -16,15 +16,13 @@ from __future__ import annotations
import inspect import inspect
import logging import logging
from typing import ( from typing import Any
Any, from typing import AsyncGenerator
AsyncGenerator, from typing import Awaitable
Awaitable, from typing import Callable
Callable, from typing import Literal
Literal, from typing import Optional
Optional, from typing import Union
Union,
)
from google.genai import types from google.genai import types
from pydantic import BaseModel from pydantic import BaseModel
@ -152,7 +150,12 @@ class LlmAgent(BaseAgent):
# LLM-based agent transfer configs - Start # LLM-based agent transfer configs - Start
disallow_transfer_to_parent: bool = False disallow_transfer_to_parent: bool = False
"""Disallows LLM-controlled transferring to the parent agent.""" """Disallows LLM-controlled transferring to the parent agent.
NOTE: Setting this as True also prevents this agent to continue reply to the
end-user. This behavior prevents one-way transfer, in which end-user may be
stuck with one agent that cannot transfer to other agents in the agent tree.
"""
disallow_transfer_to_peers: bool = False disallow_transfer_to_peers: bool = False
"""Disallows LLM-controlled transferring to the peer agents.""" """Disallows LLM-controlled transferring to the peer agents."""
# LLM-based agent transfer configs - End # LLM-based agent transfer configs - End