Skip to content

Commit deea392

Browse files
committed
update token check logic
1 parent dd83feb commit deea392

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/llm_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def query_llm(prompt: str, client=None, model=None, provider="openai", image_pat
199199
prompt_tokens=response.usage.prompt_tokens,
200200
completion_tokens=response.usage.completion_tokens,
201201
total_tokens=response.usage.total_tokens,
202-
reasoning_tokens=response.usage.reasoning_tokens if model == "o1" else None # Only o1 model provides reasoning tokens
202+
reasoning_tokens=response.usage.reasoning_tokens if model.lower().startswith("o") else None # Only checks if model starts with "o", e.g., o1, o1-preview, o1-mini, o3, etc. Can update this logic to specific models in the future.
203203
)
204204

205205
# Calculate cost

0 commit comments

Comments
 (0)