Skip to content

v0.0.12

Latest
Compare
Choose a tag to compare
@markbackman markbackman released this 30 Jan 14:06
· 12 commits to main since this release
2fd5d80

Added

  • Support for inline action handlers in flow configuration:
    • Actions can now be registered via handler field in config
    • Maintains backwards compatibility with manual registration
    • Built-in actions (tts_say, end_conversation) work without changes

Example of the new pattern:

"pre_actions": [
    {
        "type": "check_status",
        "handler": check_status_handler
    }
]

Changed

  • Updated dynamic flows to use per-function, inline transition callbacks:
    • Removed global transition_callback from FlowManager initialization
    • Transition handlers are now specified directly in function definitions
    • Dynamic transitions are now specified similarly to the static flows'
      transition_to field
    • Breaking change: Dynamic flows must now specify transition callbacks in
      function configuration

Example of the new pattern:

# Before - global transition callback
flow_manager = FlowManager(
    transition_callback=handle_transition
)

# After - inline transition callbacks
def create_node() -> NodeConfig:
    return {
        "functions": [{
            "type": "function",
            "function": {
                "name": "collect_age",
                "handler": collect_age,
                "description": "Record user's age",
                "parameters": {...},
                "transition_callback": handle_age_collection
            }
        }]
    }
  • Updated dynamic flow examples to use the new transition_callback pattern.

Fixed

  • Fixed an issue where multiple, consecutive function calls could result in two completions.