mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-10 06:34:59 +00:00
test openrouter model properties
This commit is contained in:
parent
d1e0a196b5
commit
668a0500ff
2 changed files with 27 additions and 7 deletions
|
@ -28,9 +28,9 @@ class OpenRouterModel(Model):
|
|||
found = next((details for details in cached_model_details if details.get('id') == name), None)
|
||||
|
||||
if found:
|
||||
self.max_context_tokens = int(found.context_length)
|
||||
self.prompt_price = float(found.get('pricing').get('prompt')) * 1000
|
||||
self.completion_price = float(found.get('pricing').get('completion')) * 1000
|
||||
self.max_context_tokens = int(found.get('context_length'))
|
||||
self.prompt_price = round(float(found.get('pricing').get('prompt')) * 1000,6)
|
||||
self.completion_price = round(float(found.get('pricing').get('completion')) * 1000,6)
|
||||
|
||||
else:
|
||||
raise ValueError(f'invalid openrouter model: {name}')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue