Rename @flows_direct_function to @flows_tool_options#282
Merged
Conversation
Align the decorator name with Pipecat 1.4.0's @tool_options, making clearer that it configures a direct function's call options. The new @flows_tool_options is built on Pipecat's @tool_options (so the metadata now lives under the _pipecat_* attributes the wrapper reads). @flows_direct_function becomes a deprecated alias that warns and delegates. Bumps the minimum pipecat-ai to 1.4.0, where @tool_options and the timeout_secs naming land.
kompfner
reviewed
Jun 10, 2026
| @@ -0,0 +1 @@ | |||
| - Added the `@flows_tool_options(cancel_on_interruption=..., timeout_secs=...)` decorator for configuring a Flows direct function's call options. It is the Flows-flavored counterpart to Pipecat's `@tool_options` (and is built on it), replacing `@flows_direct_function` with a name that makes clearer that it configures call options. Requires `pipecat-ai>=1.4.0`. | |||
Contributor
There was a problem hiding this comment.
Nit: does it matter to the reader here that it requires a newer version of Pipecat? They'll know, upon bumping their version of Pipecat Flows, that the newer Pipecat is required.
kompfner
reviewed
Jun 10, 2026
| """Decorator to attach additional metadata to a Pipecat direct function. | ||
| """Configure a Flows direct function's call options. | ||
|
|
||
| This decorator is optional; use it to override the defaults for a Flows |
Contributor
There was a problem hiding this comment.
Nit: everything after "use it to override the defaults for a Flows direct function" feels like it might be TMI to the reader.
kompfner
reviewed
Jun 10, 2026
| """Test that cancel_on_interruption can be set to False via decorator.""" | ||
|
|
||
| @flows_direct_function(cancel_on_interruption=False) | ||
| @flows_tool_options(cancel_on_interruption=False) |
kompfner
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@flows_tool_options(cancel_on_interruption=..., timeout_secs=...)as the primary decorator for configuring a Flows direct function's call options. It is the Flows-flavored counterpart to Pipecat's@tool_optionsand is built on it, so the metadata now lives under the_pipecat_*attributes the wrapper reads.@flows_direct_function— it is now an alias of@flows_tool_optionsthat emits aDeprecationWarningand delegates to it. The alias will be removed in a future version.pipecat-aito1.4.0(core dependency and the examples extra), where@tool_optionsand thetimeout_secsnaming land.The point of the rename is naming alignment: matching Pipecat's
@tool_optionsmakes it clearer that the decorator configures a direct function's call options, rather than implying it's what makes a function a "direct function."@tool_optionsand thetimeout_secsdecorator argument only exist on Pipecat'smain(unreleased). This PR cannot pass CI or be merged untilpipecat-ai1.4.0 is published to PyPI — CI installs the releasedpipecat-ai, which still lackstool_options. Verified locally against the Pipecat checkout viaPYTHONPATH.Breaking Changes
@flows_direct_functionkeeps working (with a deprecation warning). The minimumpipecat-airequirement rises to 1.4.0.Testing
(Run against a Pipecat 1.4.0+ environment.) Includes a new test that
@flows_direct_functionwarns but still attaches the options, and that@flows_tool_optionsdoes not warn.🤖 Generated with Claude Code