feat: add multi-image vision analysis
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
生成标题
|
||||
{% elif item.operation_type == "image" %}
|
||||
生成图片
|
||||
{% elif item.operation_type == "vision" %}
|
||||
图片理解
|
||||
{% else %}
|
||||
{{ item.operation_type }}
|
||||
{% endif %}
|
||||
|
||||
+16
-1
@@ -503,6 +503,12 @@ class PortalAccountFlowTests(TestCase):
|
||||
url="https://provider-secret.example/v1/images/edits",
|
||||
model_sku="secret-sku-image-2",
|
||||
)
|
||||
vision_alias = self.create_model_alias(
|
||||
alias="vision-standard",
|
||||
operation_type=ModelAlias.OperationType.VISION,
|
||||
capabilities=["text", "vision"],
|
||||
model_sku="secret-sku-vision",
|
||||
)
|
||||
PricingRule.objects.create(
|
||||
operation_type=title_alias.operation_type,
|
||||
alias=title_alias.alias,
|
||||
@@ -516,12 +522,18 @@ class PortalAccountFlowTests(TestCase):
|
||||
points_cost=12,
|
||||
is_active=False,
|
||||
)
|
||||
PricingRule.objects.create(
|
||||
operation_type=vision_alias.operation_type,
|
||||
alias=vision_alias.alias,
|
||||
resolution="",
|
||||
points_cost=3,
|
||||
)
|
||||
self.client.force_login(user)
|
||||
|
||||
response = self.client.get("/models")
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(len(response.context["models"]), 2)
|
||||
self.assertEqual(len(response.context["models"]), 3)
|
||||
self.assertContains(response, "可用模型")
|
||||
self.assertContains(response, "title-standard")
|
||||
self.assertContains(response, "生成标题")
|
||||
@@ -529,6 +541,9 @@ class PortalAccountFlowTests(TestCase):
|
||||
self.assertContains(response, "2 点")
|
||||
self.assertContains(response, "image-edit")
|
||||
self.assertContains(response, "生成图片")
|
||||
self.assertContains(response, "vision-standard")
|
||||
self.assertContains(response, "图片理解")
|
||||
self.assertContains(response, "3 点")
|
||||
self.assertContains(response, "需要")
|
||||
self.assertContains(response, "暂未定价")
|
||||
self.assertNotContains(response, "secret-sku")
|
||||
|
||||
Reference in New Issue
Block a user