Repository navigation
v1.1.0
Changed
- Widened function handler return types to align with Pipecat's upstream
FunctionCallResultCallbackcontract.ZeroArgFunctionHandler,LegacyFunctionHandler, andFlowFunctionHandlernow returnAwaitable[Any], andConsolidatedFunctionResult's first slot isAny(previouslyFlowResult | None). This is strictly additive: handlers that returnedFlowResultstill validate, and handlers that returned arbitrary JSON-serializable values (e.g. the quickstart's(color, next_node)string tuple) are now type-clean.FlowResultremains available as an optional convenience type for handlers that want a structuredstatus/errorshape. (PR #263)
Deprecated
-
FlowResultis deprecated and will be removed in 2.0.0. It is no longer referenced by any handler type in the library, and Pipecat's upstream function-call-result contract isAnyend-to-end. Define your ownTypedDictif you want a structured result, or return any JSON-serializable value. ExistingFlowResultsubclasses continue to work until removal. (PR #263) -
Single-argument (legacy) action handlers are deprecated and will be removed in 2.0.0. Update handlers to accept
(action: dict, flow_manager: FlowManager). ADeprecationWarningis emitted once perActionManagerinstance the first time a legacy action handler is invoked. (PR #263) -
0-argument and 1-argument (legacy) function handlers are deprecated and will be removed in 2.0.0. Update handlers to accept
(args: FlowArgs, flow_manager: FlowManager). ADeprecationWarningis emitted once perFlowManagerinstance the first time each deprecated shape is invoked. TheZeroArgFunctionHandlertype is now exported so the currently supported handler shapes are fully described by the public type surface. (PR #263)
Fixed
FlowsDirectFunctionis now defined asCallable[..., Awaitable[ConsolidatedFunctionResult]]instead of aProtocolwith**kwargs: Any. Python's Protocol system cannot express "any concrete named-parameter list" against**kwargs: Any, which caused pyright to reject direct functions with normal named parameters (e.g.async def f(flow_manager: FlowManager, llm: str)). Runtime validation of the expected shape is unchanged and still handled byFlowsDirectFunctionWrapper.validate_function. (PR #263)