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 logging
from typing import (
Any,
AsyncGenerator,
Awaitable,
Callable,
Literal,
Optional,
Union,
)
from typing import Any
from typing import AsyncGenerator
from typing import Awaitable
from typing import Callable
from typing import Literal
from typing import Optional
from typing import Union
from google.genai import types
from pydantic import BaseModel
@ -152,7 +150,12 @@ class LlmAgent(BaseAgent):
# LLM-based agent transfer configs - Start
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
"""Disallows LLM-controlled transferring to the peer agents."""
# LLM-based agent transfer configs - End