can i mix raw function tool and non raw function t...
# ask-ai
p
can i mix raw function tool and non raw function tool?
t
Thanks for reaching out, Mario. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — great question. Yes, you can mix raw function tools and non-raw function tools in LiveKit Agents. • Non-raw function tools are defined with the normal
@function_tool
decorator (Python) or
llm.tool()
(Node), where the function signature and docstring automatically provide the tool schema. • Raw function tools are defined by supplying an explicit JSON schema via the
raw_schema
parameter to
@function_tool
or
function_tool()
so you control the exact schema. Both kinds of tools register together and are available to the LLM as callable tools. You can, for example, include a regular decorated tool like
lookup_weather
alongside a
get_weather
tool defined with
raw_schema
in the same agent — LiveKit will route and execute them uniformly. If you’d like, tell me which language you’re using (Python or Node) and share a short example of the tools you want to combine — I can show the exact code pattern to register both in one agent. Sources: Tool definition and use | LiveKit Documentation
p
so why am i getting this from openai FunctionToolInfo' object has no attribute 'raw_schema'
t
Thanks — that error makes sense to be confused by. I’m here to help get to the root cause. Quick acknowledgement: you’re seeing the Python/Node runtime raise "'FunctionToolInfo' object has no attribute 'raw_schema'" when mixing raw and non-raw tools. That usually means the code expects a
raw_schema
attribute on a tool metadata object but received a
FunctionToolInfo
instance that doesn’t have it. To diagnose quickly, please share the following so I can give a precise fix: 1. Which language and SDK are you using (Python or Node)? 2. A minimal code snippet that registers the tools and triggers the error (the tool definitions, how you register them with the agent, and the call that fails). 3. The exact error traceback (full stack trace) you get from OpenAI/LiveKit. 4. SDK/version numbers (e.g., package versions for livekit/agent or related libs). 5. Whether the tool that uses
raw_schema
is defined with
@function_tool(raw_schema=...)
(decorator) or with
function_tool(raw_schema=...)
programmatic registration. Common things to check while you share those: • Ensure tools defined with
raw_schema
are actually created using the parameter
raw_schema=
rather than attaching
raw_schema
later. • Confirm you’re not mixing two different tool metadata objects (e.g., passing a
FunctionToolInfo
where code expects a
RawFunctionToolInfo
or similar). The error indicates the runtime tried to access
raw_schema
on an object that only holds the normal function tool info. • If you use programmatic registration, compare the objects returned/used when you register non-raw vs raw tools and make sure the agent registration code handles both kinds. If you paste your snippet and the traceback, I’ll point out the exact line to change and provide the corrected code.