agentops icon indicating copy to clipboard operation
agentops copied to clipboard

[Bug]: Multiple return values from a decorated function become a list

Open zli11010 opened this issue 1 year ago • 2 comments

Contact Details

No response

📦 Package Version

0.3.18

🎞️ Framework Version

No response

🔎 Describe the Bug

If I do something like

@agentops.record_action("Action")
def some_action():
    return 0, 1

then the output becomes the list [0, 1].

This is an issue because I'm using a repository where they check whether the output from a function is a specific subclass of tuple, so when I added the decorator to the function the code broke.

🤝 Contribution

  • [X] Yes, I'd be happy to submit a pull request with these changes.
  • [ ] I need some guidance on how to contribute.
  • [ ] I'd prefer the AgentOps team to handle this update.

zli11010 avatar Dec 27 '24 23:12 zli11010

I fixed the bug in this pr: https://github.com/AgentOps-AI/agentops/pull/608

zli11010 avatar Dec 27 '24 23:12 zli11010

Taking a look at the PR, thanks! @zli11010 are you using a specific project or rolling out an agent of your own?

areibman avatar Dec 28 '24 05:12 areibman

Closing this issue as the decorator return value handling has been improved through multiple decorator enhancement PRs including PR #747 'AgentOps Decorators Implementation', PR #1008 'Tool decorator enhance', and other decorator-related improvements that addressed tuple return value issues.