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

Include 3.5 Sonnet as a tool calling LLM #3904

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

evan-danswer
Copy link
Contributor

@evan-danswer evan-danswer commented Feb 5, 2025

Description

https://linear.app/danswer/issue/DAN-1411/35-sonnet-tool-calling

Technically, all Claude 3 models are tool-calling enabled. However, we've specifically noticed an issue where in our "non explicit tool calling" flow, 3.5 Sonnet responds with a textual decision not to use the search tool, then emits some explicit search tool calls during the following .stream() call (which for NON-explicit-tool-calling LLMs is intended to emit an LLM-only answer). So, we're adding 3.5 Sonnet to our list of explicit tool callers so we can skip that initial failed step.

In addition, Claude models LOVE making sequential tool calls. We tried several prompts (including "don't call tools) that Sonnet simply ignored. One solution is to allow sequential tool calls (see tools-evan-sequential), which honestly didn't look too bad in the UI. The one thing I'm concerned about is citations; I don't think they work with repeated searches at the moment.

This PR introduces an Anthropic-specific workaround where we use the non-tool-calling message construction (i.e. add to the user message instead of adding explicit tool messages) for anthropic models.

How Has This Been Tested?

Correct Behavior through UI + Unit tests

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 11:32pm

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.

1 participant