in function_tools_executed event can i access any ...
# ask-ai
w
in function_tools_executed event can i access any custom property set in the current agent?
t
Thanks for reaching out, Test. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for reaching out! I wanted to share that the
function_tools_executed
event doesn’t directly give access to custom properties set in your current agent, like
self.light_on
. This event mainly reports the results of executed function tools, including details such as
function_calls
and
function_call_outputs
, but it doesn’t reveal the agent’s internal state or custom properties. To work with and access custom properties smoothly, here’s a helpful approach: • Keep the state as instance variables within your agent class. • Then, access or update this state inside your tool functions or event handlers by using the agent instance. If anything feels unclear or you’d like some examples to guide you further, please don’t hesitate to ask—I’m here to help! Sources: Events and error handling | LiveKit Docs | agents/src/voice/agent_activity.ts | examples/voice_agents/silent_function_call.py
w
by session._agent ?
t
Thank you for your question! Just to make sure I understand correctly, are you asking if
session._agent
can be used to access custom properties of the agent? If that's the case, it would be really helpful if you could share a bit more about your use case or what you're hoping to accomplish. I'm here to help you through this!
w
yes
can i access in @session.on("function_tools_executed") def _on_function_tools_executed(ev: FunctionToolsExecutedEvent):
can i access in @session.on("function_tools_executed") def _on_function_tools_executed(ev: FunctionToolsExecutedEvent):