Skip to content

Conversation

lusmoura
Copy link
Collaborator

@lusmoura lusmoura commented Jun 6, 2024

  • Fix calculator citations not working by renaming the output field to text instead of result
  • Improve calculator description for better input generations
  • Strip comments and new lines from generated expression to avoid parsing issues

AI Description

The pull request makes changes to the calculator tool's functionality and description.

Summary

The calculator tool has been enhanced to offer a wider range of mathematical and conversion capabilities. The tool's description has been updated to reflect its expanded capabilities, including a large library of customizable functions, unit and currency conversions, and symbolic calculations.

Changes

  • The code parameter's description has been updated to specify that it should be a "valid mathematical expression" for the calculator to evaluate.
  • The is_available method has been updated to reflect the new capabilities of the calculator tool.
  • The description of the calculator tool has been expanded to highlight its multi-purpose nature, including features like unit calculations, currency conversion, and symbolic calculations.
  • The call method has been modified to improve expression handling:
    • The parameters dictionary now uses the key "expression" instead of "code".
    • Empty lines and lines starting with # are removed from the expression before evaluation.
    • The exception handling has been updated to include the specific error message, providing more detailed feedback to the user.

@lusmoura lusmoura requested a review from tianjing-li June 6, 2024 14:54
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@3af28b2). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #178   +/-   ##
=======================================
  Coverage        ?   87.91%           
=======================================
  Files           ?      114           
  Lines           ?     3666           
  Branches        ?        0           
=======================================
  Hits            ?     3223           
  Misses          ?      443           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@tianjing-li tianjing-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved !

@lusmoura lusmoura merged commit 55190fa into main Jun 6, 2024
@lusmoura lusmoura deleted the luisa/fix_calculator_citations branch June 6, 2024 15:10
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.

3 participants