feat: normalization embedding;feat: model top_p param config (#3723)

* edit form force close image select

* model config

* feat: normalization embedding

* perf: add share page title force refresh
This commit is contained in:
Archer
2025-02-08 12:16:46 +08:00
committed by GitHub
parent 42b2046f96
commit 51e17a47fa
30 changed files with 388 additions and 94 deletions

View File

@@ -14,7 +14,8 @@ weight: 804
1.
2. 新增 - LLM 模型支持 top_p, response_format, json_schema 参数。
3. 新增 - Doubao1.5 模型预设。
4. 优化 - 模型未配置时错误提示
5. 修复 - 简易模式,切换到其他非视觉模型时候,会强制关闭图片识别
6. 修复 - o1,o3 模型,在测试时候字段映射未生效导致报错
7. 修复 - 公众号对话空指针异常
4. 新增 - 向量模型支持归一化配置,以便适配未归一化的向量模型,例如 Doubao 的 embedding 模型。
5. 优化 - 模型未配置时错误提示
6. 修复 - 简易模式,切换到其他非视觉模型时候,会强制关闭图片识别
7. 修复 - o1,o3 模型,在测试时候字段映射未生效导致报错
8. 修复 - 公众号对话空指针异常。

View File

@@ -0,0 +1,15 @@
---
title: 'V4.9.0(进行中)'
description: 'FastGPT V4.9.0 更新说明'
icon: 'upgrade'
draft: false
toc: true
weight: 804
---
## 完整更新内容
1. 修复 - 简易模式,切换到其他非视觉模型时候,会强制关闭图片识别。
2. 修复 - o1,o3 模型,在测试时候字段映射未生效导致报错。

View File

@@ -64,6 +64,7 @@ export type EmbeddingModelItemType = PriceType &
maxToken: number; // model max token
weight: number; // training weight
hidden?: boolean; // Disallow creation
normalization?: boolean; // normalization processing
defaultConfig?: Record<string, any>; // post request config
dbConfig?: Record<string, any>; // Custom parameters for storage
queryConfig?: Record<string, any>; // Custom parameters for query

View File

@@ -8,6 +8,12 @@
"maxResponse": 4000,
"quoteMaxToken": 120000,
"maxTemperature": 0.99,
"showTopP": true,
"responseFormatList": [
"text",
"json_object"
],
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -30,6 +36,12 @@
"maxResponse": 4000,
"quoteMaxToken": 120000,
"maxTemperature": 0.99,
"showTopP": true,
"responseFormatList": [
"text",
"json_object"
],
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -52,6 +64,12 @@
"maxResponse": 4000,
"quoteMaxToken": 900000,
"maxTemperature": 0.99,
"showTopP": true,
"responseFormatList": [
"text",
"json_object"
],
"showStopSign": true,
"vision": false,
"toolChoice": false,
"functionCall": false,
@@ -74,6 +92,12 @@
"maxResponse": 4000,
"quoteMaxToken": 120000,
"maxTemperature": 0.99,
"showTopP": true,
"responseFormatList": [
"text",
"json_object"
],
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -96,6 +120,8 @@
"maxResponse": 1000,
"quoteMaxToken": 6000,
"maxTemperature": 0.99,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": false,
"functionCall": false,
@@ -118,6 +144,8 @@
"maxResponse": 1000,
"quoteMaxToken": 6000,
"maxTemperature": 0.99,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": false,
"functionCall": false,

View File

@@ -8,6 +8,8 @@
"maxResponse": 8000,
"quoteMaxToken": 100000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -30,6 +32,8 @@
"maxResponse": 8000,
"quoteMaxToken": 100000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": true,
"functionCall": false,
@@ -52,6 +56,8 @@
"maxResponse": 8000,
"quoteMaxToken": 100000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": true,
"functionCall": false,
@@ -74,6 +80,8 @@
"maxResponse": 4096,
"quoteMaxToken": 100000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": true,
"functionCall": false,

View File

@@ -7,7 +7,10 @@
"maxContext": 64000,
"maxResponse": 8000,
"quoteMaxToken": 60000,
"maxTemperature": 1.5,
"maxTemperature": 1,
"showTopP": true,
"responseFormatList": ["text", "json_object"],
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -42,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
}
]
}

View File

@@ -8,6 +8,8 @@
"maxResponse": 4000,
"quoteMaxToken": 32000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -30,6 +32,8 @@
"maxResponse": 4000,
"quoteMaxToken": 32000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -52,6 +56,8 @@
"maxResponse": 12000,
"quoteMaxToken": 256000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -74,6 +80,8 @@
"maxResponse": 4000,
"quoteMaxToken": 32000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": true,
"functionCall": false,
@@ -96,6 +104,8 @@
"maxResponse": 4000,
"quoteMaxToken": 4000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -118,6 +128,8 @@
"maxResponse": 4000,
"quoteMaxToken": 32000,
"maxTemperature": 1,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": false,
@@ -153,7 +165,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Doubao-vision-lite-32k",
@@ -175,7 +189,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Doubao-pro-4k",
@@ -197,7 +213,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Doubao-pro-32k",
@@ -219,7 +237,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Doubao-pro-128k",
@@ -241,7 +261,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Doubao-vision-pro-32k",
@@ -263,21 +285,25 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Doubao-embedding-large",
"name": "Doubao-embedding-large",
"defaultToken": 512,
"maxToken": 4096,
"type": "embedding"
"type": "embedding",
"normalization": true
},
{
"model": "Doubao-embedding",
"name": "Doubao-embedding",
"defaultToken": 512,
"maxToken": 4096,
"type": "embedding"
"type": "embedding",
"normalization": true
}
]
}

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "ERNIE-4.0-Turbo-8K",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "ERNIE-Lite-8K",
@@ -65,7 +69,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "ERNIE-Speed-128K",
@@ -87,7 +93,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Embedding-V1",

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "gemini-1.5-pro",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "gemini-2.0-flash-exp",
@@ -65,7 +69,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "gemini-2.0-flash-thinking-exp-1219",
@@ -87,7 +93,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "gemini-2.0-flash-thinking-exp-01-21",
@@ -109,7 +117,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "gemini-exp-1206",
@@ -131,7 +141,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "text-embedding-004",

View File

@@ -20,7 +20,9 @@
"customExtractPrompt": "",
"usedInToolCall": true,
"defaultConfig": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "llama-3.3-70b-versatile",
@@ -41,7 +43,9 @@
"customExtractPrompt": "",
"usedInToolCall": true,
"defaultConfig": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
}
]
}

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-lite",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-pro",
@@ -65,7 +69,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-standard",
@@ -87,7 +93,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-turbo-vision",
@@ -109,7 +117,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-turbo",
@@ -131,7 +141,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-vision",
@@ -153,7 +165,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "hunyuan-embedding",

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "internlm3-8b-instruct",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
}
]
}

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "abab6.5s-chat",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "speech-01-turbo",

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "ministral-8b-latest",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "mistral-large-latest",
@@ -65,7 +69,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "mistral-small-latest",
@@ -87,7 +93,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
}
]
}

View File

@@ -21,7 +21,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "moonshot-v1-32k",
@@ -43,7 +46,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "moonshot-v1-128k",
@@ -65,7 +71,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
}
]
}

View File

@@ -9,7 +9,11 @@
"quoteMaxToken": 60000,
"maxTemperature": 1.2,
"showTopP": true,
"responseFormatList": ["text", "json_object", "json_schema"],
"responseFormatList": [
"text",
"json_object",
"json_schema"
],
"showStopSign": true,
"vision": true,
"toolChoice": true,
@@ -32,6 +36,13 @@
"maxResponse": 4000,
"quoteMaxToken": 60000,
"maxTemperature": 1.2,
"showTopP": true,
"responseFormatList": [
"text",
"json_object",
"json_schema"
],
"showStopSign": true,
"vision": true,
"toolChoice": true,
"functionCall": true,
@@ -71,7 +82,9 @@
"fieldMap": {
"max_tokens": "max_completion_tokens"
},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "o1-mini",
@@ -97,7 +110,9 @@
"fieldMap": {
"max_tokens": "max_completion_tokens"
},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "o1",
@@ -123,7 +138,9 @@
"fieldMap": {
"max_tokens": "max_completion_tokens"
},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "o1-preview",
@@ -149,7 +166,9 @@
"fieldMap": {
"max_tokens": "max_completion_tokens"
},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "gpt-3.5-turbo",
@@ -158,6 +177,8 @@
"maxResponse": 4000,
"quoteMaxToken": 13000,
"maxTemperature": 1.2,
"showTopP": true,
"showStopSign": true,
"vision": false,
"toolChoice": true,
"functionCall": true,
@@ -178,6 +199,8 @@
"maxResponse": 4000,
"quoteMaxToken": 60000,
"maxTemperature": 1.2,
"showTopP": true,
"showStopSign": true,
"vision": true,
"toolChoice": true,
"functionCall": true,

View File

@@ -21,7 +21,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "qwen-plus",
@@ -43,7 +46,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "qwen-vl-plus",
@@ -63,7 +69,9 @@
"usedInQueryExtension": true,
"customExtractPrompt": "",
"usedInToolCall": true,
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "qwen-max",
@@ -85,7 +93,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "qwen-vl-max",
@@ -107,7 +118,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "qwen-coder-turbo",
@@ -129,7 +142,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "qwen2.5-7b-instruct",
@@ -151,7 +166,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "qwen2.5-14b-instruct",
@@ -173,7 +191,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "qwen2.5-32b-instruct",
@@ -195,7 +216,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
},
{
"model": "qwen2.5-72b-instruct",
@@ -217,7 +241,10 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true,
"responseFormatList": ["text", "json_object"]
}
]
}

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "Qwen/Qwen2-VL-72B-Instruct",
@@ -42,7 +44,9 @@
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"defaultConfig": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "deepseek-ai/DeepSeek-V2.5",
@@ -64,7 +68,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "BAAI/bge-m3",

View File

@@ -19,7 +19,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "generalv3",
@@ -39,7 +41,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "pro-128k",
@@ -59,7 +63,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "generalv3.5",
@@ -79,7 +85,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "max-32k",
@@ -101,7 +109,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "4.0Ultra",
@@ -123,7 +133,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
}
]
}

View File

@@ -19,7 +19,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1-8k",
@@ -39,7 +41,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1-32k",
@@ -59,7 +63,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1-128k",
@@ -79,7 +85,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1-256k",
@@ -99,7 +107,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1o-vision-32k",
@@ -119,7 +129,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1v-8k",
@@ -139,7 +151,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-1v-32k",
@@ -159,7 +173,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-2-mini",
@@ -179,7 +195,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-2-16k",
@@ -199,7 +217,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-2-16k-exp",
@@ -219,7 +239,9 @@
"customCQPrompt": "",
"customExtractPrompt": "",
"defaultSystemChatPrompt": "",
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "step-tts-mini",

View File

@@ -21,7 +21,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
},
{
"model": "yi-vision-v2",
@@ -43,7 +45,9 @@
"usedInToolCall": true,
"defaultConfig": {},
"fieldMap": {},
"type": "llm"
"type": "llm",
"showTopP": true,
"showStopSign": true
}
]
}

View File

@@ -56,7 +56,14 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
const [tokens, vectors] = await Promise.all([
countPromptTokens(input),
Promise.all(res.data.map((item) => unityDimensional(item.embedding)))
Promise.all(
res.data
.map((item) => unityDimensional(item.embedding))
.map((item) => {
if (model.normalization) return normalization(item);
return item;
})
)
]);
return {
@@ -87,3 +94,15 @@ function unityDimensional(vector: number[]) {
return resultVector.concat(zeroVector);
}
// normalization processing
function normalization(vector: number[]) {
if (vector.some((item) => item > 1)) {
// Calculate the Euclidean norm (L2 norm)
const norm = Math.sqrt(vector.reduce((sum, val) => sum + val * val, 0));
// Normalize the vector by dividing each component by the norm
return vector.map((val) => val / norm);
}
return vector;
}

View File

@@ -46,6 +46,8 @@
"model.max_temperature": "Max temperature",
"model.model_id": "Model ID",
"model.model_id_tip": "The unique identifier of the model, that is, the value of the actual request to the service provider model, needs to correspond to the model in the OneAPI channel.",
"model.normalization": "Normalization processing",
"model.normalization_tip": "If the Embedding API does not normalize vector values, the switch can be enabled and the system will normalize.\n\nUnnormalized APIs, which are represented by the vector search score greater than 1.",
"model.output_price": "Output price",
"model.output_price_tip": "The language model output price. If this item is configured, the model comprehensive price will be invalid.",
"model.param_name": "Parameter name",

View File

@@ -46,6 +46,8 @@
"model.max_temperature": "最大温度",
"model.model_id": "模型ID",
"model.model_id_tip": "模型的唯一标识也就是实际请求到服务商model 的值,需要与 OneAPI 渠道中的模型对应。",
"model.normalization": "归一化处理",
"model.normalization_tip": "如果Embedding API 未对向量值进行归一化,可以启用该开关,系统会进行归一化处理。\n未归一化的 API表现为向量检索得分会大于 1。",
"model.output_price": "模型输出价格",
"model.output_price_tip": "语言模型输出价格,如果配置了该项,则模型综合价格会失效",
"model.param_name": "参数名",

View File

@@ -45,6 +45,8 @@
"model.max_temperature": "最大溫度",
"model.model_id": "模型ID",
"model.model_id_tip": "模型的唯一標識也就是實際請求到服務商model 的值,需要與 OneAPI 頻道中的模型對應。",
"model.normalization": "歸一化處理",
"model.normalization_tip": "如果Embedding API 未對向量值進行歸一化,可以啟用該開關,系統會進行歸一化處理。\n\n未歸一化的 API表現為向量檢索得分會大於 1。",
"model.output_price": "模型輸出價格",
"model.output_price_tip": "語言模型輸出價格,如果配置了該項,則模型綜合價格會失效",
"model.param_name": "參數名",

View File

@@ -1,6 +1,6 @@
import { LOGO_ICON } from '@fastgpt/global/common/system/constants';
import Head from 'next/head';
import React, { useMemo } from 'react';
import React, { useEffect, useMemo } from 'react';
const NextHead = ({ title, icon, desc }: { title?: string; icon?: string; desc?: string }) => {
const formatIcon = useMemo(() => {
@@ -11,6 +11,13 @@ const NextHead = ({ title, icon, desc }: { title?: string; icon?: string; desc?:
return LOGO_ICON;
}, [icon]);
useEffect(() => {
// Force update document title
if (title) {
document.title = title;
}
}, [title]);
return (
<Head>
<title>{title}</title>

View File

@@ -816,6 +816,19 @@ const ModelEditModal = ({
)}
{isEmbeddingModel && (
<>
<Tr>
<Td>
<HStack spacing={1}>
<Box>{t('account:model.normalization')}</Box>
<QuestionTip label={t('account:model.normalization_tip')} />
</HStack>
</Td>
<Td textAlign={'right'}>
<Flex justifyContent={'flex-end'}>
<Switch {...register('normalization')} />
</Flex>
</Td>
</Tr>
<Tr>
<Td>
<HStack spacing={1}>

View File

@@ -28,12 +28,12 @@ function Error() {
return (
<Box whiteSpace={'pre-wrap'}>
{`出现未捕获的异常。
1. 私有部署用户90%由于配置文件不正确/模型未启用导致。
1. 私有部署用户90%由于配置文件不正确/模型未启用导致。请确保系统内每个系列模型至少有一个可用。
2. 部分系统不兼容相关API。大部分是苹果的safari 浏览器导致,可以尝试更换 chrome。
3. 请关闭浏览器翻译功能,部分翻译导致页面崩溃。
排除3后打开控制台的 console 查看具体报错信息。
如果提示 xxx undefined 的话,就是配置文件有错误,或者是缺少可用模型,请确保系统内每个系列模型至少有一个可用
如果提示 xxx undefined 的话,就是配置文件有错误,或者是缺少可用模型。
`}
</Box>
);

View File

@@ -57,7 +57,9 @@ async function handler(
export default NextAPI(handler);
const testLLMModel = async (model: LLMModelItemType) => {
const ai = getAIApi({});
const ai = getAIApi({
timeout: 10000
});
const requestBody = llmCompletionsBodyFormat(
{
model: model.model,
@@ -93,7 +95,9 @@ const testEmbeddingModel = async (model: EmbeddingModelItemType) => {
};
const testTTSModel = async (model: TTSModelType) => {
const ai = getAIApi();
const ai = getAIApi({
timeout: 10000
});
await ai.audio.speech.create(
{
model: model.model,

View File

@@ -241,7 +241,11 @@ const OutLink = (props: Props) => {
return (
<>
<NextHead title={props.appName || 'AI'} desc={props.appIntro} icon={props.appAvatar} />
<NextHead
title={props.appName || data?.app?.name || 'AI'}
desc={props.appIntro || data?.app?.intro}
icon={props.appAvatar || data?.app?.avatar}
/>
<PageContainer
isLoading={loading}
{...(isEmbed