dazzling-truck-32153
09/30/2025, 9:17 PMtall-airline-16756
09/30/2025, 9:17 PMtall-airline-16756
09/30/2025, 9:18 PM@function_tool decorator—is shared with the LLM to help it understand exactly when and how to call the tool.
For example, in Python:
@function_tool()
async def get_weather(self, location: str) -> str:
"""
Called when the user asks about the weather.
Args:
location: The location to get the weather for
"""
return f"The weather in {location} is sunny today."
Here, the docstring is carefully parsed and sent to the LLM as the tool's description, including helpful details about the parameters. This way, the LLM can make smart decisions about invoking the function based on what the user wants.
The framework makes sure this description is included in the tool schema sent to different LLM providers like OpenAI, Anthropic, Google Gemini, and AWS Bedrock. If no description is given, it might simply default to "No description provided."
Please feel free to reach out if you’d like me to explain anything further or if there’s anything else I can help with!
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/llm.py | avatars/hedra/dynamically_created_avatar/agent.py | agents/src/llm/tool_context.ts | Tool definition and use | LiveKit Docsdazzling-truck-32153
09/30/2025, 9:54 PMclass AlreadyBooked(AgentTask[bool]):
def __init__(self, chat_ctx=None):
super().__init__(
instructions="""Let caller know they have an existing booking and them if they want to speak with someone""",
chat_ctx=chat_ctx,
)
async def on_enter(self) -> None:
logger.info(":eyes: Booking EXISTS!")
await self.session.generate_reply(
instructions=f"Ask if they want to speak with someone in regards to their painting project"
)
@function_tool
async def transfer_call(self, ctx: RunContext[HelperSessionInfo], transfer_requested: bool = False, transfer_declined: bool = False) -> None:
"""Transfer caller
Args: transfer_declined: bool set True if user declines transfer.
"""
logger.info("🏃♂️➡️ Running transfer_call function")
participant_id = ctx.session.userdata.participant_identity
job_ctx = get_job_context()
room_name = job_ctx.room.name
if transfer_requested:
logging.info(":white_check_mark: xfer requested")
await transfer_caller(participant_identity=participant_id,room_name=room_name)
self.complete(True)
if transfer_declined:
logging.info(":x: xfer declined")
self.complete(True)
if user declines it does not work no matter what i trytall-airline-16756
09/30/2025, 9:55 PMtransfer_declined parameter. Could you please share a bit more information?
• Where did you come across the transfer_declined setting? Was it in documentation, a code example, or maybe an error message?
• Are you noticing any specific errors or unexpected behavior when you're trying to do call transfers?
• Which SIP provider are you working with? For example, Telnyx or Wavix?
With these details, we'll be able to pinpoint the problem and find the best way to resolve it together.
Sources: agent.py | Docs::Telephony