Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update gemini_handler.py to better handle NL+FC model output #617

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

vandyxiaowei
Copy link
Contributor

Gemini model is capable of outputting NL/text (for reasoning or verbosity) for the corresponding FC as different parts. Simply concatenation of text with FC will result in decode failures. So we should only extract FC parts for decoding and eval when it exists in the content.

See below example:

OUTPUT: ["Okay, I can help you with that. Let's calculate the future value for each investment option:\n\n\nBond:\n\n", {"calculate_future_value": "{"present_value": 5000, "periods": 10, "interest_rate": 0.05}"}, "\n\nMutual Fund:\n\n", {"calculate_future_value": "{"periods": 15, "interest_rate": 0.07, "present_value": 2000}"}, "\n\n\nStocks:\n\n", {"calculate_future_value": "{"periods": 20, "interest_rate": 0.1, "present_value": 1000}"}"]

Copy link
Collaborator

@HuanzhiMao HuanzhiMao left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
LGTM

@HuanzhiMao HuanzhiMao added the BFCL-General General BFCL Issue label Sep 8, 2024
@ShishirPatil ShishirPatil merged commit cec2bfc into ShishirPatil:main Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFCL-General General BFCL Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants