Fix bug concerning no pricing submitted by responses

Integrate also alias0 into the list of models

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
This commit is contained in:
Víctor Mayoral Vilches 2025-05-20 09:53:23 +02:00
parent 25faeb59ee
commit 5d5ba9a2f0
4 changed files with 17 additions and 2 deletions

View File

@ -120,6 +120,9 @@ class FuzzyCommandCompleter(Completer):
# Standard models always available
standard_models = [
# Alias models
"alias0",
# Claude 3.7 models
"claude-3-7-sonnet-20250219",

View File

@ -67,11 +67,19 @@ class ModelCommand(Command):
# Define model categories and their models for easy reference
# pylint: disable=invalid-name
MODEL_CATEGORIES = {
"Alias": [
{
"name": "alias0",
"description": (
"Best model for Cybersecurity AI tasks"
)
}
],
"Claude 3.7": [
{
"name": "claude-3-7-sonnet-20250219",
"description": (
"Best model for complex reasoning and creative tasks"
"Excellent model for complex reasoning and creative tasks"
)
}
],

View File

@ -577,6 +577,10 @@ class OpenAIChatCompletionsModel(Model):
response.usage.input_tokens = response.usage.prompt_tokens
if hasattr(response.usage, 'completion_tokens') and not hasattr(response.usage, 'output_tokens'):
response.usage.output_tokens = response.usage.completion_tokens
# Ensure cost is properly initialized
if not hasattr(response, 'cost'):
response.cost = None
return ModelResponse(
output=items,

View File

@ -158,7 +158,7 @@ class DataRecorder: # pylint: disable=too-few-public-methods
# Obtener el coste de la interacción
interaction_cost = 0.0
if hasattr(msg, "cost"):
interaction_cost = float(msg.cost)
interaction_cost = float(msg.cost) if msg.cost is not None else 0.0
# Usar el total_cost proporcionado o actualizar el interno
if total_cost is not None: