From 1dcd4a9b2b220285b1af662f1ef58d4f0c0ea559 Mon Sep 17 00:00:00 2001 From: Salman Mohammed Date: Wed, 26 Feb 2025 11:04:16 -0500 Subject: [PATCH] clippy, bump output tokens to max 8192 --- crates/goose-cli/src/session/output.rs | 2 +- crates/goose-server/src/routes/reply.rs | 5 +---- crates/goose/src/providers/formats/anthropic.rs | 4 +++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/goose-cli/src/session/output.rs b/crates/goose-cli/src/session/output.rs index 536a84846..a87a86804 100644 --- a/crates/goose-cli/src/session/output.rs +++ b/crates/goose-cli/src/session/output.rs @@ -101,7 +101,7 @@ pub fn render_message(message: &Message) { println!("Image: [data: {}, type: {}]", image.data, image.mime_type); } MessageContent::Thinking(thinking) => { - if let Ok(show_thinking) = std::env::var("GOOSE_CLI_SHOW_THINKING") { + if std::env::var("GOOSE_CLI_SHOW_THINKING").is_ok() { println!("\n{}", style("Thinking:").dim().italic()); print_markdown(&thinking.thinking, theme); } diff --git a/crates/goose-server/src/routes/reply.rs b/crates/goose-server/src/routes/reply.rs index d0b5b9752..b398c4eab 100644 --- a/crates/goose-server/src/routes/reply.rs +++ b/crates/goose-server/src/routes/reply.rs @@ -10,10 +10,7 @@ use bytes::Bytes; use futures::{stream::StreamExt, Stream}; use goose::message::{Message, MessageContent}; -use mcp_core::{ - content::{self, Content}, - role::Role, -}; +use mcp_core::{content::Content, role::Role}; use serde::Deserialize; use serde_json::{json, Value}; use std::{ diff --git a/crates/goose/src/providers/formats/anthropic.rs b/crates/goose/src/providers/formats/anthropic.rs index 5e397dfd4..2b1aec650 100644 --- a/crates/goose/src/providers/formats/anthropic.rs +++ b/crates/goose/src/providers/formats/anthropic.rs @@ -274,7 +274,9 @@ pub fn create_request( return Err(anyhow!("No valid messages to send to Anthropic API")); } - let max_tokens = model_config.max_tokens.unwrap_or(4096); + // https://docs.anthropic.com/en/docs/about-claude/models/all-models#model-comparison-table + // Claude 3.7 supports max output tokens up to 8192 + let max_tokens = model_config.max_tokens.unwrap_or(8192); let mut payload = json!({ "model": model_config.model_name, "messages": anthropic_messages,