how can i catch this warning/error on my LiveKit a...
# ask-ai
a
how can i catch this warning/error on my LiveKit agent?
Copy code
WARNING - unknown AI function `search`
t
Thanks for reaching out, Sebastián. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking how to catch or handle the warning: WARNING - unknown AI function
search
Acknowledging: that warning means the LLM tried to call a function named
search
that your agent hasn't registered. What you can do (pick one): • If you want a
search
tool: define and register it with your agent. ◦ Python example:
Copy code
from livekit.agents import function_tool, Agent, RunContext

    class MyAgent(Agent):
        @function_tool()
        async def search(self, context: RunContext, query: str) -> str:
            # implement search logic
            return f"Results for: {query}"

    agent = MyAgent()
• If
search
should not be called: fix your tool descriptions / prompt so the model doesn't try to call it (remove ambiguous wording that implies a search capability). • Monitoring: you cannot programmatically "catch" that internal warning — the agent logs it and ignores the unknown call. Use agent logs and your tools' logging to observe when the model attempts unintended calls. Quick diagnostic questions to help further: • Do you want to implement a
search
tool, or prevent the model from calling it? • Which SDK are you using (Python or Node.js)? Sources: Tool definition and use | LiveKit docs | https://blog.livekit.io/streamline-troubleshooting-with-agent-observability/#/portal|
a
how can i do that?
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!