Skip to content

Commit

Permalink
[Feature] To think or not to think (Sonnet 3.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
amidabuddha committed Feb 28, 2025
1 parent 752c695 commit 7327f53
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions config.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ model_max_tokens = 8192
model_name = "claude-3-7-sonnet-latest"
model_output_pricing_per_1k = 0.015

[chat.models.anthropic-sonnet-latest-thinking]
api_key = "YOUR_ANTHROPIC_API_KEY"
model_input_pricing_per_1k = 0.003
model_max_tokens = 8192
model_name = "claude-3-7-sonnet-latest"
model_output_pricing_per_1k = 0.015

[chat.models.anthropic-opus]
api_key = "YOUR_ANTHROPIC_API_KEY"
model_input_pricing_per_1k = 0.015
Expand Down
4 changes: 3 additions & 1 deletion console_gpt/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def chat(console, data, managed_user_prompt) -> None:
}
if cached is not False:
params["cached"] = cached

if model_title == "anthropic-sonnet-latest-thinking":
params["thinking"] = True

response = handle_with_exceptions(lambda: client.chat.completions.create(**params))

if response not in ["interrupted", "error_appeared"] and streaming:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unichat~=3.5.4
unichat~=3.5.6
pillow~=10.3.0
questionary~=2.0.1
rich~=13.7.0
Expand Down

0 comments on commit 7327f53

Please sign in to comment.