Visitar URL original
converting defaultdict to dict in RunResponse.to_dict() by ravin-m · Pull Request #2005 · agno-agi/agno · GitHub
Skip to content

converting defaultdict to dict in RunResponse.to_dict() - #2005

Closed
ravin-m wants to merge 2 commits into
agno-agi:mainfrom
ravin-m:fix/asdict
Closed

ravin-m wants to merge 2 commits into
agno-agi:mainfrom
ravin-m:fix/asdict

Conversation

@ravin-m

@ravin-m ravin-m commented Feb 4, 2025 •

Copy link
Copy Markdown

asdict doesn't support defaultdict in Python 3.11. So converting RunResponse.metrics to dict before running asdict.

Description

Fixes # (issue)

asdict doesn't support defaultdict in Python 3.11. So RunResponse.to_dict() doesn't work.
https://github.com/python/cpython/pull/32056c

Type of change

Please check the options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Model update (Addition or modification of models)
  • Other (please describe):

Checklist

  • Adherence to standards: Code complies with Agno’s style guidelines and best practices.
  • Formatting and validation: You have run ./scripts/format.sh and ./scripts/validate.sh to ensure code is formatted and linted.
  • Self-review completed: A thorough review has been performed by the contributor(s).
  • Documentation: Docstrings and comments have been added or updated for any complex logic.
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable).
  • Tested in a clean environment: Changes have been tested in a clean environment to confirm expected behavior.
  • Tests (optional): Tests have been added or updated to cover any new or changed functionality.

Additional Notes

Include any deployment notes, performance implications, security considerations, or other relevant information (e.g., screenshots or logs if applicable).

asdict doesn't support defaultdict in Python 3.11. So converting RunResponse.metrics to dict before running asdict.
@ravin-m
ravin-m requested a review from a team as a code owner February 4, 2025 12:50
@dirkbrnd

dirkbrnd commented Feb 7, 2025

Copy link
Copy Markdown
Contributor

@ravin-m thanks for this! I fixed it in another way and we are releasing the fix now.

@dirkbrnd dirkbrnd closed this Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants