-
Notifications
You must be signed in to change notification settings - Fork 91
Add support for default tools in FlowManager initialization #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for default tools in FlowManager initialization #212
Conversation
|
@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.
|
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.
|
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:
|
Hehe, just noticed that your branch name actually calls them |
|
@Pranay-ai can you add a changelog entry for this? With that, I think we'll be ready to merge this down. |
Pranay-ai
left a comment
There was a problem hiding this 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.
@markbackman Great Will do that. Thanks |
Document the addition of global_functions parameter in FlowManager and related example updates.
markbackman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again! 🙌
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.