assistant: Add foundation for receiving tool uses from Anthropic models (#17170)

This PR updates the Assistant with support for receiving tool uses from
Anthropic models and capturing them as text in the context editor.

This is just laying the foundation for tool use. We don't yet fulfill
the tool uses yet, or define any tools for the model to use.

Here's an example of what it looks like using the example `get_weather`
tool from the Anthropic docs:

<img width="644" alt="Screenshot 2024-08-30 at 1 51 13 PM"
src="https://github.com/user-attachments/assets/3614f953-0689-423c-8955-b146729ea638">

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-30 14:05:55 -04:00 committed by GitHub
parent ea25d438d1
commit 68ea661711
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 114 additions and 25 deletions

View file

@ -2048,7 +2048,8 @@ impl Context {
LanguageModelRequest {
messages: request_messages,
stop: vec![],
tools: Vec::new(),
stop: Vec::new(),
temperature: 1.0,
}
}
@ -2398,7 +2399,8 @@ impl Context {
}));
let request = LanguageModelRequest {
messages: messages.collect(),
stop: vec![],
tools: Vec::new(),
stop: Vec::new(),
temperature: 1.0,
};