Allows you to specify the tool_choice parameter for Runs (see Open Ai docs). This parameter allows you to force the assistant to use a particular tool.
Example usage, forcing the use of the vector store file search:
from marvin.beta import Assistant, Thread
from marvin.tools.assistants import FileSearch
# new thread
thread = Thread()
# Load some assistant with a vector store attached
ai = Assistant.load(assistant_id="<assistant ID>", tools=[FileSearch],
tool_resources={
"file_search": {
"vector_store_ids": ["<vector store ID>"]
}
})
# Run the thread, forcing the use of FileSearch
thread.run(assistant=ai, tool_choice=FileSearch)
Closes https://github.com/PrefectHQ/marvin/issues/927
Allows you to specify the
tool_choice
parameter for Runs (see Open Ai docs). This parameter allows you to force the assistant to use a particular tool.Example usage, forcing the use of the vector store file search: