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

[js/ai]: Improve toolChoice generation option #1886

Open
mbleigh opened this issue Feb 6, 2025 · 0 comments
Open

[js/ai]: Improve toolChoice generation option #1886

mbleigh opened this issue Feb 6, 2025 · 0 comments

Comments

@mbleigh
Copy link
Collaborator

mbleigh commented Feb 6, 2025

Right now, if you do {toolChoice: 'required'} it's easy to put yourself into an infinite loop of tool calls. I propose the following:

  1. Add a required-once option that passed through required in the first turn of the generation loop, but any after that.
  2. Throw an error when doing {toolChoice: 'required'} unless one of the following is met:
  • returnToolRequests is true
  • one or more of the tools passed to the call has metadata.interrupt on it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant