Skip to content

Conversation

@Pranay-ai
Copy link
Contributor

@Pranay-ai Pranay-ai commented Oct 24, 2025

This PR adds support for default tools that persist across all nodes in the flow.
Key changes:

New default_tools parameter in FlowManager.init() (line 105) - accepts an optional list of FlowsFunctionSchema that will be available at every node
New instance variable _default_tools (line 153) - stores the default tools list, defaulting to an empty list if not provided
New tracking set _default_function_names (line 173) - tracks which function names belong to default tools (likely used elsewhere to ensure they're always registered alongside node-specific tools)

This allows callers to define tools once during initialization that will automatically be included at every node, rather than having to manually add them to each node's configuration.

@vercel
Copy link

vercel bot commented Oct 24, 2025

@Pranay-ai is attempting to deploy a commit to the Daily Team on Vercel.

A member of the Team first needs to authorize it.

Updated help function to provide time information and removed unnecessary comments.
@markbackman markbackman requested a review from kompfner October 24, 2025 13:40
@markbackman
Copy link
Contributor

Thanks for submitting this. Default tools that persist across nodes is a good idea!

@kompfner can you take a look when you get a moment?

- “global” communicates “cross-node” a bit more clearly than “default”, in my opinion
- in Pipecat Flows, “function” is more standard terminology than “tool”

Also, add global function usage to the "main" food ordering example, eliminating the need for a dedicated example.

Also, update the example with a more natural use-case: asking for a delivery estimate.
…and simplify its implementation in the process.
@kompfner
Copy link
Contributor

Hey @Pranay-ai! Agreed, having a way to specify tools that apply to all nodes is a great idea!

I checked out your code to review it and ended up making a few changes. Will push them up to this branch in a minute. Here's a summary:

  • Renamed default_tools to global_functions, for 2 reasons:
    • “global” communicates “cross-node” a bit more clearly than “default”, I think
    • in Pipecat Flows, “function” is more standard terminology than “tool”
  • Added global function usage to the "main" food ordering examples, eliminating the need for a dedicated example
  • Updated the example global function to make it a bit more natural/realistic: getting a delivery estimate
  • Added support for FlowsDirectFunctions in addition to FlowsFunctionSchemas
  • Simplified the implementation

@kompfner
Copy link
Contributor

Renamed default_tools to global_functions

Hehe, just noticed that your branch name actually calls them global_functions already 😛

@markbackman
Copy link
Contributor

@Pranay-ai can you add a changelog entry for this? With that, I think we'll be ready to merge this down.

Copy link
Contributor Author

@Pranay-ai Pranay-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great This Simplifies the Code and Workflow.

@Pranay-ai
Copy link
Contributor Author

@Pranay-ai can you add a changelog entry for this? With that, I think we'll be ready to merge this down.

@markbackman Great Will do that. Thanks

Document the addition of global_functions parameter in FlowManager
and related example updates.
Copy link
Contributor

@markbackman markbackman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! 🙌

@markbackman markbackman merged commit 71dd410 into pipecat-ai:main Oct 24, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants