mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
fix for openrouter which doesn't return completion prices
This commit is contained in:
parent
179b648864
commit
48c680ffb6
1 changed files with 1 additions and 1 deletions
|
@ -693,7 +693,7 @@ class Coder:
|
|||
raise Exception("No data found in openai response!")
|
||||
|
||||
tokens = None
|
||||
if hasattr(completion, "usage"):
|
||||
if hasattr(completion, "usage") and completion.usage is not None:
|
||||
prompt_tokens = completion.usage.prompt_tokens
|
||||
completion_tokens = completion.usage.completion_tokens
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue