Skip to content

fix: Tool Calling w/ Parsing#108

Merged
monoxgas merged 2 commits into
mainfrom
fix/tool-calling-with-parsing
May 21, 2025
Merged

fix: Tool Calling w/ Parsing#108
monoxgas merged 2 commits into
mainfrom
fix/tool-calling-with-parsing

Conversation

@monoxgas

@monoxgas monoxgas commented May 21, 2025

Copy link
Copy Markdown
Contributor

Notes

In general attempting to make the mixed form behavior of tool calls (xml especially) with parsing logic.

  • Cleaned some internal cloning behavior when it comes to callbacks.
  • Removed None behavior being used to indicate tool call stopping conditions
  • Added new Stop exception for breaking from recursive tool calls.
  • Some small adjustments here and there.

Generated Summary

  • Introduced a new Stop exception in rigging.error.py to indicate a stopping condition within the pipeline.
  • Changed variable names related to stopping tool calls in rigging/chat.py for clarity:
    • stop_on_tool_calls to add_tool_stop_token.
    • Updated method signatures and internal logic to utilize add_tool_stop_token.
  • Enhanced the ChatPipeline.clone method to allow selective cloning of callbacks, thereby providing more control during pipeline instantiation.
  • Updated various method implementations (e.g., _then_tools, _then_parse) to utilize the new stopping mechanism.
  • Adjusted handling of tool calls in the Tool class to return a stop condition instead of a boolean to streamline flow control.
  • Updated tests in tests/test_tool.py to reflect changes in method signatures and assert logic that checks the new stop return value instead of continuation.
  • Various improvements in error messages in rigging/prompt.py for better user guidance.

This summary was generated with ❤️ by rigging

Generated Summary

  • Introduced Stop class to manage stopping conditions within pipelines.
  • Replaced stop_on_tool_calls with add_tool_stop_token for improved clarity in the ChatPipeline.
  • Enhanced clone method in ChatPipeline to control callback cloning behavior, allowing conditional cloning of callbacks based on the new callbacks parameter.
  • Changed corresponding references throughout the ChatPipeline methods to accommodate new naming and logic for stopping tool calls.
  • Updated method signatures in ChatPipeline to reflect changes, ensuring backward compatibility while enhancing functionality.
  • Modified response handling in tool calls to reflect the change from should_continue to stop, simplifying control flow during tool call executions.
  • Adjusted various docstrings across classes to maintain clarity and accuracy, especially concerning expected behavior with exceptions and stopping conditions.
  • Added new tests to validate the updated behavior of tool calls, focusing on the stop condition instead of should_continue.

These changes improve the overall robustness and readability of the code, making it easier to manage tool calls and stopping conditions.

This summary was generated with ❤️ by rigging

@monoxgas monoxgas requested a review from a team as a code owner May 21, 2025 02:00
@dreadnode-renovate-bot dreadnode-renovate-bot Bot added the area/tests Changes to test files and testing infrastructure label May 21, 2025
@monoxgas monoxgas merged commit 95cc796 into main May 21, 2025
5 checks passed
@monoxgas monoxgas deleted the fix/tool-calling-with-parsing branch May 21, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tests Changes to test files and testing infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant