Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 080e00b6c6 | |||
| 6e69f09842 | |||
| 2dd45854c1 | |||
| 72de68e1ff | |||
| 6844d73c9d |
6
app.py
6
app.py
@@ -163,7 +163,7 @@ def get_parse_prompt_template(category_type, category_id=None, subcategory_id=No
|
|||||||
重要要求:
|
重要要求:
|
||||||
1. 图片中可能包含1个或多个产品,请识别所有产品
|
1. 图片中可能包含1个或多个产品,请识别所有产品
|
||||||
2. 如果是多张图片,请综合分析所有图片内容
|
2. 如果是多张图片,请综合分析所有图片内容
|
||||||
3. 数字字段只返回数字,不带单位
|
3. **提取数据时保留原始单位**:字段标签中如有单位标注(如($)、(GB)、(MHz)等),提取时请带上对应单位,保持数据完整性
|
||||||
4. 如果某字段没有提及,返回null
|
4. 如果某字段没有提及,返回null
|
||||||
5. 返回格式:如果识别到多个产品,返回数组 [对象列表]; 如果只有一个产品,返回单个对象
|
5. 返回格式:如果识别到多个产品,返回数组 [对象列表]; 如果只有一个产品,返回单个对象
|
||||||
6. 只返回JSON数据,不要其他内容"""
|
6. 只返回JSON数据,不要其他内容"""
|
||||||
@@ -255,7 +255,7 @@ def parse_with_llm(text, category_type, images=None, category_id=None, subcatego
|
|||||||
重要要求:
|
重要要求:
|
||||||
1. 图片中可能包含1个或多个产品,请识别所有产品
|
1. 图片中可能包含1个或多个产品,请识别所有产品
|
||||||
2. 如果是多张图片,请综合分析所有图片内容
|
2. 如果是多张图片,请综合分析所有图片内容
|
||||||
3. 数字字段只返回数字,不带单位
|
3. **提取数据时保留原始单位**:字段标签中如有单位标注(如($)、(GB)、(MHz)等),提取时请带上对应单位,保持数据完整性
|
||||||
4. 如果某字段没有提及,返回null
|
4. 如果某字段没有提及,返回null
|
||||||
5. 返回格式:如果识别到多个产品,返回数组 [对象列表]; 如果只有一个产品,返回单个对象
|
5. 返回格式:如果识别到多个产品,返回数组 [对象列表]; 如果只有一个产品,返回单个对象
|
||||||
6. 只返回JSON数据,不要其他内容"""
|
6. 只返回JSON数据,不要其他内容"""
|
||||||
@@ -307,7 +307,7 @@ def parse_with_llm(text, category_type, images=None, category_id=None, subcatego
|
|||||||
|
|
||||||
要求:
|
要求:
|
||||||
1. 根据文本内容智能提取各个字段的值
|
1. 根据文本内容智能提取各个字段的值
|
||||||
2. 数字字段只返回数字,不带单位
|
2. **提取数据时保留原始单位**:字段标签中如有单位标注(如($)、(GB)、(MHz)等),提取时请带上对应单位,保持数据完整性
|
||||||
3. 如果某字段在文本中没有提及,返回null
|
3. 如果某字段在文本中没有提及,返回null
|
||||||
4. 返回JSON格式,不要包含任何其他内容
|
4. 返回JSON格式,不要包含任何其他内容
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "description",
|
"key": "description",
|
||||||
"label": "描述",
|
"label": "描述",
|
||||||
@@ -448,6 +464,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "description",
|
"key": "description",
|
||||||
"label": "描述",
|
"label": "描述",
|
||||||
@@ -668,6 +700,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "description",
|
"key": "description",
|
||||||
"label": "描述",
|
"label": "描述",
|
||||||
@@ -803,6 +851,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "产品简介",
|
"description": "产品简介",
|
||||||
"key": "description",
|
"key": "description",
|
||||||
@@ -962,6 +1026,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "产品简介",
|
"description": "产品简介",
|
||||||
"input_style": "long",
|
"input_style": "long",
|
||||||
@@ -1079,6 +1159,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"description": "车型简介",
|
"description": "车型简介",
|
||||||
"input_style": "long",
|
"input_style": "long",
|
||||||
@@ -1225,6 +1321,22 @@
|
|||||||
"required": false,
|
"required": false,
|
||||||
"input_style": "normal"
|
"input_style": "normal"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "official_urls",
|
||||||
|
"label": "官网地址",
|
||||||
|
"type": "json",
|
||||||
|
"description": "产品官网链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "reference_urls",
|
||||||
|
"label": "数据参考",
|
||||||
|
"type": "json",
|
||||||
|
"description": "参数来源链接,JSON数组格式:[{\"url\":\"https://...\",\"title\":\"...\"}]",
|
||||||
|
"required": false,
|
||||||
|
"input_style": "long"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "description",
|
"key": "description",
|
||||||
"label": "描述",
|
"label": "描述",
|
||||||
|
|||||||
@@ -534,11 +534,30 @@
|
|||||||
container.innerHTML = '';
|
container.innerHTML = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取当前筛选值 - 根据容器ID判断
|
||||||
|
let currentFilter = '';
|
||||||
|
if (containerId === 'model-subcategory-filters') currentFilter = modelSubcategoryFilter;
|
||||||
|
else if (containerId === 'gpu-subcategory-filters') currentFilter = gpuSubcategoryFilter;
|
||||||
|
else if (containerId === 'cpu-subcategory-filters') currentFilter = cpuSubcategoryFilter;
|
||||||
|
else if (containerId === 'dynamic-subcategory-filters') currentFilter = dynamicSubcategoryFilter;
|
||||||
|
|
||||||
|
// 渲染子类别按钮
|
||||||
container.innerHTML = cat.subcategories.map(sub => `
|
container.innerHTML = cat.subcategories.map(sub => `
|
||||||
<button onclick="${filterFunction}('${sub.id}')" class="px-3 py-1 rounded text-sm bg-white border text-gray-600 hover:bg-gray-100">
|
<button onclick="${filterFunction}('${sub.id}')" class="px-3 py-1 rounded text-sm ${currentFilter === sub.id ? 'bg-indigo-600 text-white' : 'bg-white border text-gray-600 hover:bg-gray-100'}">
|
||||||
<i class="${sub.icon} mr-1"></i>${sub.name}
|
<i class="${sub.icon || 'ri-folder-line'} mr-1"></i>${sub.name}
|
||||||
</button>
|
</button>
|
||||||
`).join('');
|
`).join('');
|
||||||
|
|
||||||
|
// 更新"全部"按钮的样式 - 它是容器前面的那个按钮
|
||||||
|
const allBtn = container.previousElementSibling;
|
||||||
|
if (allBtn && allBtn.tagName === 'BUTTON') {
|
||||||
|
if (currentFilter === '') {
|
||||||
|
allBtn.className = 'px-3 py-1 rounded text-sm bg-indigo-600 text-white';
|
||||||
|
} else {
|
||||||
|
allBtn.className = 'px-3 py-1 rounded text-sm bg-white border text-gray-600 hover:bg-gray-100';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const colorMap = {
|
const colorMap = {
|
||||||
|
|||||||
Reference in New Issue
Block a user