image strugles
This commit is contained in:
@@ -118,9 +118,9 @@ class ModelRegistry:
|
|||||||
|
|
||||||
# Handle AIModelConfig instance
|
# Handle AIModelConfig instance
|
||||||
if rate_type == 'input':
|
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':
|
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':
|
elif rate_type == 'image':
|
||||||
return model.cost_per_image or Decimal('0')
|
return model.cost_per_image or Decimal('0')
|
||||||
|
|
||||||
|
|||||||
@@ -287,7 +287,9 @@ class AIModelConfigSerializer(serializers.Serializer):
|
|||||||
def get_pricing_display(self, obj):
|
def get_pricing_display(self, obj):
|
||||||
"""Generate pricing display string based on model type"""
|
"""Generate pricing display string based on model type"""
|
||||||
if obj.model_type == 'text':
|
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':
|
elif obj.model_type == 'image':
|
||||||
return f"${obj.cost_per_image} per image"
|
return f"${obj.cost_per_image} per image"
|
||||||
return ""
|
return ""
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ const CurrentProcessingCard: React.FC<CurrentProcessingCardProps> = ({
|
|||||||
<Button
|
<Button
|
||||||
onClick={handlePause}
|
onClick={handlePause}
|
||||||
disabled={isPausing}
|
disabled={isPausing}
|
||||||
variant="outline"
|
variant="primary"
|
||||||
tone="warning"
|
tone="warning"
|
||||||
size="sm"
|
size="sm"
|
||||||
startIcon={<PauseIcon className="w-4 h-4" />}
|
startIcon={<PauseIcon className="w-4 h-4" />}
|
||||||
@@ -299,8 +299,8 @@ const CurrentProcessingCard: React.FC<CurrentProcessingCardProps> = ({
|
|||||||
<Button
|
<Button
|
||||||
onClick={handleCancel}
|
onClick={handleCancel}
|
||||||
disabled={isCancelling}
|
disabled={isCancelling}
|
||||||
variant="ghost"
|
variant="primary"
|
||||||
tone="neutral"
|
tone="danger"
|
||||||
size="sm"
|
size="sm"
|
||||||
>
|
>
|
||||||
{isCancelling ? 'Cancelling...' : 'Cancel'}
|
{isCancelling ? 'Cancelling...' : 'Cancel'}
|
||||||
|
|||||||
Reference in New Issue
Block a user