Support 8192 output tokens for Claude Sonnet 3.5 (#16358)

Release Notes:

- Added support for 8192 output tokens from Claude Sonnet 3.5
(https://x.com/alexalbert__/status/1812921642143900036)
This commit is contained in:
Roy Williams 2024-08-16 11:47:39 -04:00 committed by GitHub
parent 7eab57a264
commit b4f5f5024e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 37 additions and 8 deletions

View file

@ -286,7 +286,7 @@ impl LanguageModelRequest {
}
}
pub fn into_anthropic(self, model: String) -> anthropic::Request {
pub fn into_anthropic(self, model: String, max_output_tokens: u32) -> anthropic::Request {
let mut new_messages: Vec<anthropic::Message> = Vec::new();
let mut system_message = String::new();
@ -353,7 +353,7 @@ impl LanguageModelRequest {
anthropic::Request {
model,
messages: new_messages,
max_tokens: 4092,
max_tokens: max_output_tokens,
system: Some(system_message),
tools: Vec::new(),
tool_choice: None,