image strugles
This commit is contained in:
@@ -118,9 +118,9 @@ class ModelRegistry:
|
||||
|
||||
# Handle AIModelConfig instance
|
||||
if rate_type == 'input':
|
||||
return model.input_cost_per_1m or Decimal('0')
|
||||
return model.cost_per_1k_input or Decimal('0')
|
||||
elif rate_type == 'output':
|
||||
return model.output_cost_per_1m or Decimal('0')
|
||||
return model.cost_per_1k_output or Decimal('0')
|
||||
elif rate_type == 'image':
|
||||
return model.cost_per_image or Decimal('0')
|
||||
|
||||
|
||||
@@ -287,7 +287,9 @@ class AIModelConfigSerializer(serializers.Serializer):
|
||||
def get_pricing_display(self, obj):
|
||||
"""Generate pricing display string based on model type"""
|
||||
if obj.model_type == 'text':
|
||||
return f"${obj.input_cost_per_1m}/{obj.output_cost_per_1m} per 1M"
|
||||
input_cost = obj.cost_per_1k_input or 0
|
||||
output_cost = obj.cost_per_1k_output or 0
|
||||
return f"${input_cost}/{output_cost} per 1K tokens"
|
||||
elif obj.model_type == 'image':
|
||||
return f"${obj.cost_per_image} per image"
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user