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

Support for tool_choice parameter for runs #927

Open
3 tasks done
andehr opened this issue May 16, 2024 · 0 comments
Open
3 tasks done

Support for tool_choice parameter for runs #927

andehr opened this issue May 16, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@andehr
Copy link

andehr commented May 16, 2024

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to look for a similar issue and didn't find it.
  • I searched the Marvin documentation for this feature.

Describe the current behavior

Apologies if I'm doing this wrong, but I've consulted the documentation and github, and can't find a way to do this so far:

When creating a Run with thread.run(assistant=ai) I'd like to force the assistant to use a specific tool, in this case FileSearchTool.

With the open ai api, that's accomplished with the tool_choice parameter to the create run endpoint: (I think as of April 17th).

You would pass {"type": "file_search"} as its value. Which I think you'd expect to do like this?

thread.run(assistant=ai, tool_choice=FileSearchTool)

But I get a validation error trying that:

pydantic_core._pydantic_core.ValidationError: 1 validation error for Run
tool_choice
  Extra inputs are not permitted

Describe the proposed behavior

If that's not already a feature that I'm missing, then that would be the proposal to force tool use:

thread.run(assistant=ai, tool_choice=FileSearchTool)

Example Use

I find that for some complex examples, forcing a consult with the vector store for each response is worth the latency to ensure each reply is contextful. I think the least impressive bit about the vector store setup is the model's ability to decide when to use it (though yet to test gpt4o much)

Additional context

No response

@andehr andehr added the enhancement New feature or request label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant