refactor: Task/span, and model behavior cleanup#232
Merged
Conversation
Refactor xml_example to take field info like examples and descriptions into account. Rework to_pretty_xml to render multi-line text better. Add some better __str__ logic for usage, tool calls, and chats Fix multi-line text processing so they aren't over indented when parsed. - Update docs update workflow
There was a problem hiding this comment.
Pull Request Overview
This PR refactors span/task creation with better names and tags, improves XML generation and parsing behavior, and enhances string representations across various components.
- Refactored XML example generation to include field descriptions and examples with proper escaping
- Improved multi-line text processing to handle indentation consistently in XML parsing and generation
- Enhanced string representations for better debugging with shortened parameter displays and consistent formatting
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_xml_parsing.py | Added multi-line text test cases and converted inline XML to dedented format for better readability |
| tests/test_prompt.py | Simplified function definitions by removing unnecessary ellipsis syntax |
| tests/test_model.py | Added comprehensive tests for XML example generation with various field configurations |
| rigging/util.py | Refactored get_qualified_name to get_callable_name with improved naming logic and short name option |
| rigging/transform/xml_tools.py | Enhanced __str__ method to show shortened parameters for better debugging |
| rigging/transform/json_tools.py | Updated __str__ methods to use consistent formatting and parameter shortening |
| rigging/tools/base.py | Modified tool execution to use shorten instead of truncate and improved span naming |
| rigging/prompt.py | Updated function references and improved span naming with tags |
| rigging/model.py | Major refactor of XML generation with custom pretty-printing and improved example generation |
| rigging/message.py | Added shorten method and improved __str__ formatting |
| rigging/generator/base.py | Added __str__ method to Usage class for better debugging |
| rigging/completion.py | Updated callback naming and span creation |
| rigging/chat.py | Enhanced Chat __str__ method and improved span/task naming throughout |
| docs/ | Updated documentation to reflect API changes |
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.
Notes
Generated Summary
This summary was generated with ❤️ by rigging