cohere-toolkit icon indicating copy to clipboard operation
cohere-toolkit copied to clipboard

Pass tool not available back to the model

Open BeatrixCohere opened this issue 6 months ago • 1 comments

Thank you for contributing to the Cohere Toolkit!

  • [ ] PR title: "area: description"

    • Where "area" is whichever of interface, frontend, model, tools, backend, etc. is being modified. Use "docs: ..." for purely docs changes, "infra: ..." for CI changes.
    • Example: "deployment: add Azure model option"
  • [ ] PR message: Delete this entire checklist and replace with

    • Description: a description of the change
    • Issue: the issue # it fixes, if applicable
    • Dependencies: any dependencies required for this change
  • [ ] Add tests and docs: Please include testing and documentation for your changes

  • [ ] Lint and test: Run make lint and make run-tests

AI Description

The _call_tool_async function in tool_calls.py has been updated to include additional logging and error handling when a custom chat tool is not included in the "tools" parameter.

  • When a tool is not found in the AVAILABLE_TOOLS, the function now logs an info message with the event and error details.
  • Instead of returning an empty list [], the function now constructs and returns a structured output with the call and outputs fields.

BeatrixCohere avatar Aug 20 '24 14:08 BeatrixCohere