Skip to content

Document direct functions as the preferred tool pattern#895

Open
markbackman wants to merge 2 commits into
mainfrom
mb/concise-direct-functions
Open

Document direct functions as the preferred tool pattern#895
markbackman wants to merge 2 commits into
mainfrom
mb/concise-direct-functions

Conversation

@markbackman

Copy link
Copy Markdown
Contributor

@mintlify

mintlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Pipecat 🟢 Ready View Preview Jun 12, 2026, 12:07 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@github-actions

Copy link
Copy Markdown
Contributor

Broken links detected!

Please check the workflow logs for details on which links are broken and fix them before merging.

@github-actions

Copy link
Copy Markdown
Contributor

Broken links detected!

Please check the workflow logs for details on which links are broken and fix them before merging.

Rework the function-calling docs so direct functions lead and the verbose
FunctionSchema + register_function pattern is demoted to an "Advanced"
section for when you need explicit schema control.

- function-calling.mdx: direct-function-first implementation steps; new
  sections for @tool_options (cancel_on_interruption / timeout_secs),
  changing tools mid-conversation via LLMSetToolsFrame, and tools across
  LLMSwitcher service switches; deprecation note for
  register_direct_function / unregister_direct_function.
- context-management.mdx, context-summarization.mdx: convert tool snippets
  to direct functions listed in LLMContext(tools=[...]).
- data-frames.mdx: widen LLMSetToolsFrame.tools to accept direct functions /
  FunctionSchema; note auto-register/unregister.
- llm-switcher.mdx: deprecate register_direct_function().
- novita.mdx, inception.mdx: convert function-calling examples to direct
  functions.

Documents pipecat-ai/pipecat#4671.
@kompfner

Copy link
Copy Markdown
Contributor

Changed to this PR incoming, based on the work in pipecat-ai/pipecat#4709

@kompfner

kompfner commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

There's a lot of words spent in these changes on talking about "hey, look, you don't have to register these functions with the LLM service anymore!", but that won't make sense to a new reader—they don't know/care/need to know about how things used to work, how manual registration used to be the main pattern.

I'm working on changes to this PR now, so I'll include fixes for this.

A FunctionSchema can carry the handler that runs when the LLM calls the tool.
Document attaching it by passing it as the schema's handler and listing the
schema like a direct function, with @tool_options setting its call options —
across the function-calling guide, the LLMSetToolsFrame reference, and the
LLMSwitcher.register_function note.

Also strip the framing that explained tools by contrast with a manual-registration
past new readers never knew. The tools the LLM can use are whatever you list in
LLMContext(tools=[...]) or push via LLMSetToolsFrame; drop the 'no register_function
needed' / 'that's all the wiring required' lines, quarantine explicit
register_function/unregister_function to a brief, uncommon Advanced subsection, and
remove the register_direct_function deprecation note the guide never needs. Lead
'Define a tool' with the handler/schema split and point to FunctionSchema as the
alternative. Carry the same cleanup into the per-provider examples (inception,
novita) and the context-management and context-summarization pages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants