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

Use function calling to parse responses #18

Merged
merged 5 commits into from
Oct 10, 2023
Merged

Use function calling to parse responses #18

merged 5 commits into from
Oct 10, 2023

Conversation

ankrgyl
Copy link
Contributor

@ankrgyl ankrgyl commented Oct 9, 2023

A substantial fraction (20%+) of responses have parse errors. This change uses function calling to reduce that.

@ankrgyl ankrgyl requested a review from manugoyal October 9, 2023 05:49
@ankrgyl
Copy link
Contributor Author

ankrgyl commented Oct 9, 2023

CC @wong-codaio

js/llm.ts Outdated

const COT_SUFFIX = `Write out in a step by step manner your reasoning to be sure that your conclusion is correct. Avoid simply stating the correct answer at the outset. Then print only a single choice from {{__choices}} (without quotes or punctuation) on its own line corresponding to the correct answer. At the end, repeat just the answer by itself on a new line formatted as "Answer=X"`;
const COT_SUFFIX =
"Answer the question by calling the `select_choice` with your reasoning in a step-by-step matter to be sure that your conclusion is correct. Avoid simply stating the correct answer at the outset. Select a single choice by setting the `choice` parameter to a single choice from {{__choices}}.";
Copy link
Contributor

Choose a reason for hiding this comment

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

the select_choice function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch

simply stating the correct answer at the outset. Then print only a single choice from {{__choices}} (without
quotes or punctuation) on its own line corresponding to the correct answer. At the end, repeat just the
answer by itself on a new line formatted as "Answer=X"
Answer the question by calling the `select_choice` with your reasoning in a step-by-step matter to be
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@ankrgyl ankrgyl merged commit 81d8bb1 into main Oct 10, 2023
3 checks passed
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