refactor: Use get_raw_thinking_tokens in cmd_think_tokens

This commit is contained in:
Paul Gauthier (aider) 2025-03-28 20:12:04 -10:00
parent 23348f8e65
commit 8b811c610a

View file

@ -1500,7 +1500,7 @@ class Commands:
if formatted_budget is None: if formatted_budget is None:
self.io.tool_output("Thinking tokens are not currently set.") self.io.tool_output("Thinking tokens are not currently set.")
else: else:
budget = model.extra_params["thinking"].get("budget_tokens") budget = model.get_raw_thinking_tokens()
self.io.tool_output( self.io.tool_output(
f"Current thinking token budget: {budget:,} tokens ({formatted_budget})." f"Current thinking token budget: {budget:,} tokens ({formatted_budget})."
) )
@ -1510,7 +1510,7 @@ class Commands:
model.set_thinking_tokens(value) model.set_thinking_tokens(value)
formatted_budget = model.get_thinking_tokens() formatted_budget = model.get_thinking_tokens()
budget = model.extra_params["thinking"].get("budget_tokens") budget = model.get_raw_thinking_tokens()
self.io.tool_output(f"Set thinking token budget to {budget:,} tokens ({formatted_budget}).") self.io.tool_output(f"Set thinking token budget to {budget:,} tokens ({formatted_budget}).")
self.io.tool_output() self.io.tool_output()