Compare commits
8 Commits
v4.8.17-al
...
v4.8.17-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa92ef86b9 | ||
|
|
f39ea04178 | ||
|
|
bd4893ced9 | ||
|
|
b75e807f24 | ||
|
|
b2fdefdc0c | ||
|
|
896fec4b82 | ||
|
|
50bf7f9a3b | ||
|
|
da2831b948 |
@@ -215,4 +215,4 @@ https://github.com/labring/FastGPT/assets/15308462/7d3a38df-eb0e-4388-9250-2409b
|
||||
1. 允许作为后台服务直接商用,但不允许提供 SaaS 服务。
|
||||
2. 未经商业授权,任何形式的商用服务均需保留相关版权信息。
|
||||
3. 完整请查看 [FastGPT Open Source License](./LICENSE)
|
||||
4. 联系方式:Dennis@sealos.io,[点击查看商业版定价策略](https://doc.tryfastgpt.ai/docs/commercial)
|
||||
4. 联系方式:Dennis@sealos.io,[点击查看商业版定价策略](https://doc.tryfastgpt.ai/docs/shopping_cart/intro/)
|
||||
|
||||
@@ -168,6 +168,7 @@ weight: 707
|
||||
"reRankModels": [],
|
||||
"audioSpeechModels": [
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "tts-1",
|
||||
"name": "OpenAI TTS1",
|
||||
"charsPointsPrice": 0,
|
||||
@@ -182,6 +183,7 @@ weight: 707
|
||||
}
|
||||
],
|
||||
"whisperModel": {
|
||||
"provider": "OpenAI",
|
||||
"model": "whisper-1",
|
||||
"name": "Whisper1",
|
||||
"charsPointsPrice": 0
|
||||
@@ -201,7 +203,9 @@ weight: 707
|
||||
- OpenAI
|
||||
- Claude
|
||||
- Gemini
|
||||
- Meta
|
||||
- MistralAI
|
||||
- AliCloud - 阿里云
|
||||
- Qwen - 通义千问
|
||||
- Doubao - 豆包
|
||||
- ChatGLM - 智谱
|
||||
@@ -213,7 +217,10 @@ weight: 707
|
||||
- Baichuan - 百川
|
||||
- Yi - 零一万物
|
||||
- Ernie - 文心一言
|
||||
- StepFun - 阶跃星辰
|
||||
- Ollama
|
||||
- BAAI - 智源研究院
|
||||
- FishAudio
|
||||
- Other - 其他
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'V4.8.17(进行中)'
|
||||
title: 'V4.8.17(包含升级脚本)'
|
||||
description: 'FastGPT V4.8.17 更新说明'
|
||||
icon: 'upgrade'
|
||||
draft: false
|
||||
@@ -7,7 +7,16 @@ toc: true
|
||||
weight: 807
|
||||
---
|
||||
|
||||
## 运行升级脚本
|
||||
## 更新指南
|
||||
|
||||
### 1. 更新镜像:
|
||||
|
||||
- 更新 fastgpt 镜像 tag: v4.8.17
|
||||
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.17
|
||||
- Sandbox 镜像无需更新
|
||||
|
||||
|
||||
### 2. 运行升级脚本
|
||||
|
||||
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**。
|
||||
|
||||
@@ -19,6 +28,11 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4817' \
|
||||
|
||||
会将用户绑定的 OpenAI 账号移动到团队中。
|
||||
|
||||
|
||||
## 调整 completions 接口返回值
|
||||
|
||||
/api/v1/chat/completions 接口返回值调整,对话节点、工具节点等使用到模型的节点,将不再返回 `tokens` 字段,改为返回 `inputTokens` 和 `outputTokens` 字段,分别表示输入和输出的 Token 数量。
|
||||
|
||||
## 完整更新内容
|
||||
|
||||
1. 新增 - 简易模式工具调用支持数组类型插件。
|
||||
@@ -27,10 +41,12 @@ curl --location --request POST 'https://{{host}}/api/admin/initv4817' \
|
||||
4. 新增 - 商业版支持后台配置模板市场。
|
||||
5. 新增 - 商业版支持后台配置自定义工作流变量,用于与业务系统鉴权打通。
|
||||
6. 新增 - 搜索测试接口支持问题优化。
|
||||
7. 优化 - Markdown 大小测试,超出 20 万字符不使用 Markdown 组件,避免崩溃。
|
||||
8. 优化 - 知识库搜索参数,滑动条支持输入模式,可以更精准的控制。
|
||||
9. 优化 - 可用模型展示
|
||||
10. 优化 - Mongo 查询语句,增加 virtual 字段。
|
||||
11. 修复 - 文件返回接口缺少 Content-Length 头,导致通过非同源文件上传时,阿里 vision 模型无法识别图片。
|
||||
12. 修复 - 去除判断器两端字符串隐藏换行符,避免判断器失效。
|
||||
13. 修复 - 变量更新节点,手动输入更新内容时候,非字符串类型数据类型无法自动转化。
|
||||
7. 新增 - 工作流中 Input Token 和 Output Token 分开记录展示。并修复部分请求未记录输出 Token 计费问题。
|
||||
8. 优化 - Markdown 大小测试,超出 20 万字符不使用 Markdown 组件,避免崩溃。
|
||||
9. 优化 - 知识库搜索参数,滑动条支持输入模式,可以更精准的控制。
|
||||
10. 优化 - 可用模型展示UI。
|
||||
11. 优化 - Mongo 查询语句,增加 virtual 字段。
|
||||
12. 修复 - 文件返回接口缺少 Content-Length 头,导致通过非同源文件上传时,阿里 vision 模型无法识别图片。
|
||||
13. 修复 - 去除判断器两端字符串隐藏换行符,避免判断器失效。
|
||||
14. 修复 - 变量更新节点,手动输入更新内容时候,非字符串类型数据类型无法自动转化。
|
||||
15. 修复 - 豆包模型无法工具调用。
|
||||
@@ -114,15 +114,15 @@ services:
|
||||
# fastgpt
|
||||
sandbox:
|
||||
container_name: sandbox
|
||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.16 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.16 # 阿里云
|
||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.17 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.17 # 阿里云
|
||||
networks:
|
||||
- fastgpt
|
||||
restart: always
|
||||
fastgpt:
|
||||
container_name: fastgpt
|
||||
image: ghcr.io/labring/fastgpt:v4.8.16 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.16 # 阿里云
|
||||
image: ghcr.io/labring/fastgpt:v4.8.17 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.17 # 阿里云
|
||||
ports:
|
||||
- 3000:3000
|
||||
networks:
|
||||
|
||||
@@ -72,15 +72,15 @@ services:
|
||||
# fastgpt
|
||||
sandbox:
|
||||
container_name: sandbox
|
||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.16 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.16 # 阿里云
|
||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.17 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.17 # 阿里云
|
||||
networks:
|
||||
- fastgpt
|
||||
restart: always
|
||||
fastgpt:
|
||||
container_name: fastgpt
|
||||
image: ghcr.io/labring/fastgpt:v4.8.16 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.16 # 阿里云
|
||||
image: ghcr.io/labring/fastgpt:v4.8.17 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.17 # 阿里云
|
||||
ports:
|
||||
- 3000:3000
|
||||
networks:
|
||||
|
||||
@@ -53,15 +53,15 @@ services:
|
||||
wait $$!
|
||||
sandbox:
|
||||
container_name: sandbox
|
||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.16 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.16 # 阿里云
|
||||
image: ghcr.io/labring/fastgpt-sandbox:v4.8.17 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-sandbox:v4.8.17 # 阿里云
|
||||
networks:
|
||||
- fastgpt
|
||||
restart: always
|
||||
fastgpt:
|
||||
container_name: fastgpt
|
||||
image: ghcr.io/labring/fastgpt:v4.8.16 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.16 # 阿里云
|
||||
image: ghcr.io/labring/fastgpt:v4.8.17 # git
|
||||
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.17 # 阿里云
|
||||
ports:
|
||||
- 3000:3000
|
||||
networks:
|
||||
|
||||
23
packages/global/core/ai/model.d.ts
vendored
@@ -1,6 +1,13 @@
|
||||
import type { ModelProviderIdType } from './provider';
|
||||
|
||||
export type LLMModelItemType = {
|
||||
type PriceType = {
|
||||
charsPointsPrice?: number; // 1k chars=n points; 60s=n points;
|
||||
|
||||
// If inputPrice is set, the input-output charging scheme is adopted
|
||||
inputPrice?: number; // 1k tokens=n points
|
||||
outputPrice?: number; // 1k tokens=n points
|
||||
};
|
||||
export type LLMModelItemType = PriceType & {
|
||||
provider: ModelProviderIdType;
|
||||
model: string;
|
||||
name: string;
|
||||
@@ -10,8 +17,6 @@ export type LLMModelItemType = {
|
||||
quoteMaxToken: number;
|
||||
maxTemperature: number;
|
||||
|
||||
charsPointsPrice: number; // 1k chars=n points
|
||||
|
||||
censor?: boolean;
|
||||
vision?: boolean;
|
||||
|
||||
@@ -33,13 +38,12 @@ export type LLMModelItemType = {
|
||||
fieldMap?: Record<string, string>;
|
||||
};
|
||||
|
||||
export type VectorModelItemType = {
|
||||
export type VectorModelItemType = PriceType & {
|
||||
provider: ModelProviderIdType;
|
||||
model: string; // model name
|
||||
name: string; // show name
|
||||
avatar?: string;
|
||||
defaultToken: number; // split text default token
|
||||
charsPointsPrice: number; // 1k tokens=n points
|
||||
maxToken: number; // model max token
|
||||
weight: number; // training weight
|
||||
hidden?: boolean; // Disallow creation
|
||||
@@ -48,25 +52,22 @@ export type VectorModelItemType = {
|
||||
queryConfig?: Record<string, any>; // Custom parameters for query
|
||||
};
|
||||
|
||||
export type ReRankModelItemType = {
|
||||
export type ReRankModelItemType = PriceType & {
|
||||
model: string;
|
||||
name: string;
|
||||
charsPointsPrice: number;
|
||||
requestUrl: string;
|
||||
requestAuth: string;
|
||||
};
|
||||
|
||||
export type AudioSpeechModelType = {
|
||||
export type AudioSpeechModelType = PriceType & {
|
||||
provider: ModelProviderIdType;
|
||||
model: string;
|
||||
name: string;
|
||||
charsPointsPrice: number;
|
||||
voices: { label: string; value: string; bufferId: string }[];
|
||||
};
|
||||
|
||||
export type STTModelType = {
|
||||
export type STTModelType = PriceType & {
|
||||
provider: ModelProviderIdType;
|
||||
model: string;
|
||||
name: string;
|
||||
charsPointsPrice: number; // 60s = n points
|
||||
};
|
||||
|
||||
@@ -4,20 +4,25 @@ export type ModelProviderIdType =
|
||||
| 'OpenAI'
|
||||
| 'Claude'
|
||||
| 'Gemini'
|
||||
| 'Meta'
|
||||
| 'MistralAI'
|
||||
| 'Groq'
|
||||
| 'AliCloud'
|
||||
| 'Qwen'
|
||||
| 'Doubao'
|
||||
| 'ChatGLM'
|
||||
| 'DeepSeek'
|
||||
| 'Ernie'
|
||||
| 'Moonshot'
|
||||
| 'MiniMax'
|
||||
| 'SparkDesk'
|
||||
| 'Hunyuan'
|
||||
| 'Baichuan'
|
||||
| 'StepFun'
|
||||
| 'Yi'
|
||||
| 'Ernie'
|
||||
| 'Ollama'
|
||||
| 'BAAI'
|
||||
| 'FishAudio'
|
||||
| 'Other';
|
||||
|
||||
export type ModelProviderType = {
|
||||
@@ -42,6 +47,11 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
name: 'Gemini',
|
||||
avatar: 'model/gemini'
|
||||
},
|
||||
{
|
||||
id: 'Meta',
|
||||
name: 'Meta',
|
||||
avatar: 'model/meta'
|
||||
},
|
||||
{
|
||||
id: 'MistralAI',
|
||||
name: 'MistralAI',
|
||||
@@ -52,6 +62,11 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
name: 'Groq',
|
||||
avatar: 'model/groq'
|
||||
},
|
||||
{
|
||||
id: 'AliCloud',
|
||||
name: i18nT('common:model_alicloud'),
|
||||
avatar: 'model/alicloud'
|
||||
},
|
||||
{
|
||||
id: 'Qwen',
|
||||
name: i18nT('common:model_qwen'),
|
||||
@@ -67,6 +82,11 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
name: i18nT('common:model_chatglm'),
|
||||
avatar: 'model/chatglm'
|
||||
},
|
||||
{
|
||||
id: 'Ernie',
|
||||
name: i18nT('common:model_ernie'),
|
||||
avatar: 'model/ernie'
|
||||
},
|
||||
{
|
||||
id: 'DeepSeek',
|
||||
name: 'DeepSeek',
|
||||
@@ -97,21 +117,32 @@ export const ModelProviderList: ModelProviderType[] = [
|
||||
name: i18nT('common:model_baichuan'),
|
||||
avatar: 'model/baichuan'
|
||||
},
|
||||
{
|
||||
id: 'StepFun',
|
||||
name: i18nT('common:model_stepfun'),
|
||||
avatar: 'model/stepfun'
|
||||
},
|
||||
{
|
||||
id: 'Yi',
|
||||
name: i18nT('common:model_yi'),
|
||||
avatar: 'model/yi'
|
||||
},
|
||||
{
|
||||
id: 'Ernie',
|
||||
name: i18nT('common:model_ernie'),
|
||||
avatar: 'model/ernie'
|
||||
},
|
||||
|
||||
{
|
||||
id: 'Ollama',
|
||||
name: 'Ollama',
|
||||
avatar: 'model/ollama'
|
||||
},
|
||||
{
|
||||
id: 'BAAI',
|
||||
name: i18nT('common:model_baai'),
|
||||
avatar: 'model/BAAI'
|
||||
},
|
||||
{
|
||||
id: 'FishAudio',
|
||||
name: 'FishAudio',
|
||||
avatar: 'model/fishaudio'
|
||||
},
|
||||
{
|
||||
id: 'Other',
|
||||
name: i18nT('common:model_other'),
|
||||
|
||||
@@ -107,7 +107,9 @@ export type DispatchNodeResponseType = {
|
||||
mergeSignId?: string;
|
||||
|
||||
// bill
|
||||
tokens?: number;
|
||||
tokens?: number; // deprecated
|
||||
inputTokens?: number;
|
||||
outputTokens?: number;
|
||||
model?: string;
|
||||
contextTotalLen?: number;
|
||||
totalPoints?: number;
|
||||
@@ -157,6 +159,8 @@ export type DispatchNodeResponseType = {
|
||||
|
||||
// tool
|
||||
toolCallTokens?: number;
|
||||
toolCallInputTokens?: number;
|
||||
toolCallOutputTokens?: number;
|
||||
toolDetail?: ChatHistoryItemResType[];
|
||||
toolStop?: boolean;
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ export type BillSchemaType = {
|
||||
};
|
||||
|
||||
export type ChatNodeUsageType = {
|
||||
tokens?: number;
|
||||
inputTokens?: number;
|
||||
outputTokens?: number;
|
||||
totalPoints: number;
|
||||
moduleName: string;
|
||||
model?: string;
|
||||
|
||||
@@ -2,9 +2,13 @@ import { CreateUsageProps } from './api';
|
||||
import { UsageSourceEnum } from './constants';
|
||||
|
||||
export type UsageListItemCountType = {
|
||||
tokens?: number;
|
||||
inputTokens?: number;
|
||||
outputTokens?: number;
|
||||
charsLength?: number;
|
||||
duration?: number;
|
||||
|
||||
// deprecated
|
||||
tokens?: number;
|
||||
};
|
||||
export type UsageListItemType = UsageListItemCountType & {
|
||||
moduleName: string;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"author": "",
|
||||
"version": "488",
|
||||
"name": "飞书 webhook",
|
||||
"avatar": "/appMarketTemplates/plugin-feishu/avatar.svg",
|
||||
"avatar": "core/app/templates/plugin-feishu",
|
||||
"intro": "向飞书机器人发起 webhook 请求。",
|
||||
"courseUrl": "https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot#f62e72d5",
|
||||
"showStatus": false,
|
||||
|
||||
@@ -15,6 +15,9 @@ export const initFastGPTConfig = (config?: FastGPTConfigFileType) => {
|
||||
global.subPlans = config.subPlans;
|
||||
|
||||
global.llmModels = config.llmModels;
|
||||
global.llmModelPriceType = global.llmModels.some((item) => typeof item.inputPrice === 'number')
|
||||
? 'IO'
|
||||
: 'Tokens';
|
||||
global.vectorModels = config.vectorModels;
|
||||
global.audioSpeechModels = config.audioSpeechModels;
|
||||
global.whisperModel = config.whisperModel;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ChatCompletionMessageParam } from '@fastgpt/global/core/ai/type.d';
|
||||
import { createChatCompletion } from '../config';
|
||||
import { countGptMessagesTokens } from '../../../common/string/tiktoken/index';
|
||||
import { countGptMessagesTokens, countPromptTokens } from '../../../common/string/tiktoken/index';
|
||||
import { loadRequestMessages } from '../../chat/utils';
|
||||
import { llmCompletionsBodyFormat } from '../utils';
|
||||
import {
|
||||
@@ -20,7 +20,8 @@ export async function createQuestionGuide({
|
||||
customPrompt?: string;
|
||||
}): Promise<{
|
||||
result: string[];
|
||||
tokens: number;
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
}> {
|
||||
const concatMessages: ChatCompletionMessageParam[] = [
|
||||
...messages,
|
||||
@@ -29,6 +30,10 @@ export async function createQuestionGuide({
|
||||
content: `${customPrompt || PROMPT_QUESTION_GUIDE}\n${PROMPT_QUESTION_GUIDE_FOOTER}`
|
||||
}
|
||||
];
|
||||
const requestMessages = await loadRequestMessages({
|
||||
messages: concatMessages,
|
||||
useVision: false
|
||||
});
|
||||
|
||||
const { response: data } = await createChatCompletion({
|
||||
body: llmCompletionsBodyFormat(
|
||||
@@ -36,10 +41,7 @@ export async function createQuestionGuide({
|
||||
model,
|
||||
temperature: 0.1,
|
||||
max_tokens: 200,
|
||||
messages: await loadRequestMessages({
|
||||
messages: concatMessages,
|
||||
useVision: false
|
||||
}),
|
||||
messages: requestMessages,
|
||||
stream: false
|
||||
},
|
||||
model
|
||||
@@ -51,13 +53,15 @@ export async function createQuestionGuide({
|
||||
const start = answer.indexOf('[');
|
||||
const end = answer.lastIndexOf(']');
|
||||
|
||||
const tokens = await countGptMessagesTokens(concatMessages);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages);
|
||||
const outputTokens = await countPromptTokens(answer);
|
||||
|
||||
if (start === -1 || end === -1) {
|
||||
addLog.warn('Create question guide error', { answer });
|
||||
return {
|
||||
result: [],
|
||||
tokens: 0
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -69,14 +73,16 @@ export async function createQuestionGuide({
|
||||
try {
|
||||
return {
|
||||
result: json5.parse(jsonStr),
|
||||
tokens
|
||||
inputTokens,
|
||||
outputTokens
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
||||
return {
|
||||
result: [],
|
||||
tokens: 0
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { replaceVariable } from '@fastgpt/global/common/string/tools';
|
||||
import { createChatCompletion } from '../config';
|
||||
import { ChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { countGptMessagesTokens } from '../../../common/string/tiktoken/index';
|
||||
import { countGptMessagesTokens, countPromptTokens } from '../../../common/string/tiktoken/index';
|
||||
import { chatValue2RuntimePrompt } from '@fastgpt/global/core/chat/adapt';
|
||||
import { getLLMModel } from '../model';
|
||||
import { llmCompletionsBodyFormat } from '../utils';
|
||||
@@ -121,7 +121,8 @@ export const queryExtension = async ({
|
||||
rawQuery: string;
|
||||
extensionQueries: string[];
|
||||
model: string;
|
||||
tokens: number;
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
}> => {
|
||||
const systemFewShot = chatBg
|
||||
? `Q: 对话背景。
|
||||
@@ -166,7 +167,8 @@ A: ${chatBg}
|
||||
rawQuery: query,
|
||||
extensionQueries: [],
|
||||
model,
|
||||
tokens: 0
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
};
|
||||
}
|
||||
|
||||
@@ -181,7 +183,8 @@ A: ${chatBg}
|
||||
rawQuery: query,
|
||||
extensionQueries: Array.isArray(queries) ? queries : [],
|
||||
model,
|
||||
tokens: await countGptMessagesTokens(messages)
|
||||
inputTokens: await countGptMessagesTokens(messages),
|
||||
outputTokens: await countPromptTokens(answer)
|
||||
};
|
||||
} catch (error) {
|
||||
addLog.error(`Query extension error`, error);
|
||||
@@ -189,7 +192,8 @@ A: ${chatBg}
|
||||
rawQuery: query,
|
||||
extensionQueries: [],
|
||||
model,
|
||||
tokens: 0
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -4,6 +4,7 @@ export const getLLMModel = (model?: string) => {
|
||||
global.llmModels[0]
|
||||
);
|
||||
};
|
||||
|
||||
export const getDatasetModel = (model?: string) => {
|
||||
return (
|
||||
global.llmModels
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { chats2GPTMessages } from '@fastgpt/global/core/chat/adapt';
|
||||
import { countMessagesTokens } from '../../../../common/string/tiktoken/index';
|
||||
import {
|
||||
countGptMessagesTokens,
|
||||
countPromptTokens
|
||||
} from '../../../../common/string/tiktoken/index';
|
||||
import type { ChatItemType } from '@fastgpt/global/core/chat/type.d';
|
||||
import { ChatItemValueTypeEnum, ChatRoleEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import { createChatCompletion } from '../../../ai/config';
|
||||
@@ -49,7 +52,7 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
|
||||
const chatHistories = getHistories(history, histories);
|
||||
|
||||
const { arg, tokens } = await completions({
|
||||
const { arg, inputTokens, outputTokens } = await completions({
|
||||
...props,
|
||||
histories: chatHistories,
|
||||
cqModel
|
||||
@@ -59,7 +62,8 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model: cqModel.model,
|
||||
tokens,
|
||||
inputTokens: inputTokens,
|
||||
outputTokens: outputTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
|
||||
@@ -72,7 +76,8 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
query: userChatInput,
|
||||
tokens,
|
||||
inputTokens: inputTokens,
|
||||
outputTokens: outputTokens,
|
||||
cqList: agents,
|
||||
cqResult: result.value,
|
||||
contextTotalLen: chatHistories.length + 2
|
||||
@@ -82,7 +87,8 @@ export const dispatchClassifyQuestion = async (props: Props): Promise<CQResponse
|
||||
moduleName: name,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
inputTokens: inputTokens,
|
||||
outputTokens: outputTokens
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -148,7 +154,8 @@ const completions = async ({
|
||||
}
|
||||
|
||||
return {
|
||||
tokens: await countMessagesTokens(messages),
|
||||
inputTokens: await countGptMessagesTokens(requestMessages),
|
||||
outputTokens: await countPromptTokens(answer),
|
||||
arg: { type: id }
|
||||
};
|
||||
};
|
||||
|
||||
@@ -3,7 +3,8 @@ import { filterGPTMessageByMaxTokens, loadRequestMessages } from '../../../chat/
|
||||
import type { ChatItemType } from '@fastgpt/global/core/chat/type.d';
|
||||
import {
|
||||
countMessagesTokens,
|
||||
countGptMessagesTokens
|
||||
countGptMessagesTokens,
|
||||
countPromptTokens
|
||||
} from '../../../../common/string/tiktoken/index';
|
||||
import { ChatItemValueTypeEnum, ChatRoleEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import { createChatCompletion } from '../../../ai/config';
|
||||
@@ -59,7 +60,7 @@ export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
const extractModel = getLLMModel(model);
|
||||
const chatHistories = getHistories(history, histories);
|
||||
|
||||
const { arg, tokens } = await (async () => {
|
||||
const { arg, inputTokens, outputTokens } = await (async () => {
|
||||
if (extractModel.toolChoice) {
|
||||
return toolChoice({
|
||||
...props,
|
||||
@@ -114,7 +115,8 @@ export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model: extractModel.model,
|
||||
tokens,
|
||||
inputTokens: inputTokens,
|
||||
outputTokens: outputTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
|
||||
@@ -126,7 +128,8 @@ export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
query: content,
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
extractDescription: description,
|
||||
extractResult: arg,
|
||||
contextTotalLen: chatHistories.length + 2
|
||||
@@ -136,7 +139,8 @@ export async function dispatchContentExtract(props: Props): Promise<Response> {
|
||||
moduleName: name,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
inputTokens,
|
||||
outputTokens
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -249,15 +253,18 @@ const toolChoice = async (props: ActionProps) => {
|
||||
}
|
||||
})();
|
||||
|
||||
const completeMessages: ChatCompletionMessageParam[] = [
|
||||
...filterMessages,
|
||||
const AIMessages: ChatCompletionMessageParam[] = [
|
||||
{
|
||||
role: ChatCompletionRequestMessageRoleEnum.Assistant,
|
||||
tool_calls: response.choices?.[0]?.message?.tool_calls
|
||||
}
|
||||
];
|
||||
|
||||
const inputTokens = await countGptMessagesTokens(filterMessages, tools);
|
||||
const outputTokens = await countGptMessagesTokens(AIMessages);
|
||||
return {
|
||||
tokens: await countGptMessagesTokens(completeMessages, tools),
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
arg
|
||||
};
|
||||
};
|
||||
@@ -286,17 +293,21 @@ const functionCall = async (props: ActionProps) => {
|
||||
|
||||
try {
|
||||
const arg = JSON.parse(response?.choices?.[0]?.message?.function_call?.arguments || '');
|
||||
const completeMessages: ChatCompletionMessageParam[] = [
|
||||
...filterMessages,
|
||||
|
||||
const AIMessages: ChatCompletionMessageParam[] = [
|
||||
{
|
||||
role: ChatCompletionRequestMessageRoleEnum.Assistant,
|
||||
function_call: response.choices?.[0]?.message?.function_call
|
||||
}
|
||||
];
|
||||
|
||||
const inputTokens = await countGptMessagesTokens(filterMessages, undefined, functions);
|
||||
const outputTokens = await countGptMessagesTokens(AIMessages);
|
||||
|
||||
return {
|
||||
arg,
|
||||
tokens: await countGptMessagesTokens(completeMessages, undefined, functions)
|
||||
inputTokens,
|
||||
outputTokens
|
||||
};
|
||||
} catch (error) {
|
||||
console.log(response.choices?.[0]?.message);
|
||||
@@ -305,7 +316,8 @@ const functionCall = async (props: ActionProps) => {
|
||||
|
||||
return {
|
||||
arg: {},
|
||||
tokens: 0
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -370,7 +382,8 @@ Human: ${content}`
|
||||
if (!jsonStr) {
|
||||
return {
|
||||
rawResponse: answer,
|
||||
tokens: await countMessagesTokens(messages),
|
||||
inputTokens: await countMessagesTokens(messages),
|
||||
outputTokens: await countPromptTokens(answer),
|
||||
arg: {}
|
||||
};
|
||||
}
|
||||
@@ -378,7 +391,8 @@ Human: ${content}`
|
||||
try {
|
||||
return {
|
||||
rawResponse: answer,
|
||||
tokens: await countMessagesTokens(messages),
|
||||
inputTokens: await countMessagesTokens(messages),
|
||||
outputTokens: await countPromptTokens(answer),
|
||||
arg: json5.parse(jsonStr) as Record<string, any>
|
||||
};
|
||||
} catch (error) {
|
||||
@@ -386,7 +400,8 @@ Human: ${content}`
|
||||
console.log(error);
|
||||
return {
|
||||
rawResponse: answer,
|
||||
tokens: await countMessagesTokens(messages),
|
||||
inputTokens: await countMessagesTokens(messages),
|
||||
outputTokens: await countPromptTokens(answer),
|
||||
arg: {}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,7 +109,8 @@ export const runToolWithFunctionCall = async (
|
||||
|
||||
return {
|
||||
dispatchFlowResponse: [toolRunResponse],
|
||||
toolNodeTokens: 0,
|
||||
toolNodeInputTokens: 0,
|
||||
toolNodeOutputTokens: 0,
|
||||
completeMessages: requestMessages,
|
||||
assistantResponses: toolRunResponse.assistantResponses,
|
||||
runTimes: toolRunResponse.runTimes,
|
||||
@@ -126,7 +127,8 @@ export const runToolWithFunctionCall = async (
|
||||
},
|
||||
{
|
||||
dispatchFlowResponse: [toolRunResponse],
|
||||
toolNodeTokens: 0,
|
||||
toolNodeInputTokens: 0,
|
||||
toolNodeOutputTokens: 0,
|
||||
assistantResponses: toolRunResponse.assistantResponses,
|
||||
runTimes: toolRunResponse.runTimes
|
||||
}
|
||||
@@ -340,7 +342,9 @@ export const runToolWithFunctionCall = async (
|
||||
assistantToolMsgParams
|
||||
] as ChatCompletionMessageParam[];
|
||||
// Only toolCall tokens are counted here, Tool response tokens count towards the next reply
|
||||
const tokens = await countGptMessagesTokens(concatToolMessages, undefined, functions);
|
||||
// const tokens = await countGptMessagesTokens(concatToolMessages, undefined, functions);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages, undefined, functions);
|
||||
const outputTokens = await countGptMessagesTokens([assistantToolMsgParams]);
|
||||
/*
|
||||
...
|
||||
user
|
||||
@@ -375,7 +379,12 @@ export const runToolWithFunctionCall = async (
|
||||
const runTimes =
|
||||
(response?.runTimes || 0) +
|
||||
flatToolsResponseData.reduce((sum, item) => sum + item.runTimes, 0);
|
||||
const toolNodeTokens = response?.toolNodeTokens ? response.toolNodeTokens + tokens : tokens;
|
||||
const toolNodeInputTokens = response?.toolNodeInputTokens
|
||||
? response.toolNodeInputTokens + inputTokens
|
||||
: inputTokens;
|
||||
const toolNodeOutputTokens = response?.toolNodeOutputTokens
|
||||
? response.toolNodeOutputTokens + outputTokens
|
||||
: outputTokens;
|
||||
|
||||
// Check stop signal
|
||||
const hasStopSignal = flatToolsResponseData.some(
|
||||
@@ -408,7 +417,8 @@ export const runToolWithFunctionCall = async (
|
||||
|
||||
return {
|
||||
dispatchFlowResponse,
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
completeMessages,
|
||||
assistantResponses: toolNodeAssistants,
|
||||
runTimes,
|
||||
@@ -423,7 +433,8 @@ export const runToolWithFunctionCall = async (
|
||||
},
|
||||
{
|
||||
dispatchFlowResponse,
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
assistantResponses: toolNodeAssistants,
|
||||
runTimes
|
||||
}
|
||||
@@ -435,7 +446,8 @@ export const runToolWithFunctionCall = async (
|
||||
content: answer
|
||||
};
|
||||
const completeMessages = filterMessages.concat(gptAssistantResponse);
|
||||
const tokens = await countGptMessagesTokens(completeMessages, undefined, functions);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages, undefined, functions);
|
||||
const outputTokens = await countGptMessagesTokens([gptAssistantResponse]);
|
||||
// console.log(tokens, 'response token');
|
||||
|
||||
// concat tool assistant
|
||||
@@ -443,7 +455,12 @@ export const runToolWithFunctionCall = async (
|
||||
|
||||
return {
|
||||
dispatchFlowResponse: response?.dispatchFlowResponse || [],
|
||||
toolNodeTokens: response?.toolNodeTokens ? response.toolNodeTokens + tokens : tokens,
|
||||
toolNodeInputTokens: response?.toolNodeInputTokens
|
||||
? response.toolNodeInputTokens + inputTokens
|
||||
: inputTokens,
|
||||
toolNodeOutputTokens: response?.toolNodeOutputTokens
|
||||
? response.toolNodeOutputTokens + outputTokens
|
||||
: outputTokens,
|
||||
completeMessages,
|
||||
assistantResponses: [...assistantResponses, ...toolNodeAssistant.value],
|
||||
runTimes: (response?.runTimes || 0) + 1
|
||||
|
||||
@@ -165,6 +165,8 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
toolWorkflowInteractiveResponse,
|
||||
dispatchFlowResponse, // tool flow response
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
completeMessages = [], // The actual message sent to AI(just save text)
|
||||
assistantResponses = [], // FastGPT system store assistant.value response
|
||||
runTimes
|
||||
@@ -225,7 +227,8 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model,
|
||||
tokens: toolNodeTokens,
|
||||
inputTokens: toolNodeInputTokens,
|
||||
outputTokens: toolNodeOutputTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
const toolAIUsage = externalProvider.openaiAccount?.key ? 0 : totalPoints;
|
||||
@@ -255,6 +258,8 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
// 展示的积分消耗
|
||||
totalPoints: totalPointsUsage,
|
||||
toolCallTokens: toolNodeTokens,
|
||||
toolCallInputTokens: toolNodeInputTokens,
|
||||
toolCallOutputTokens: toolNodeOutputTokens,
|
||||
childTotalPoints: flatUsages.reduce((sum, item) => sum + item.totalPoints, 0),
|
||||
model: modelName,
|
||||
query: userChatInput,
|
||||
@@ -270,9 +275,10 @@ export const dispatchRunTools = async (props: DispatchToolModuleProps): Promise<
|
||||
// 工具调用本身的积分消耗
|
||||
{
|
||||
moduleName: name,
|
||||
totalPoints: toolAIUsage,
|
||||
model: modelName,
|
||||
tokens: toolNodeTokens
|
||||
totalPoints: toolAIUsage,
|
||||
inputTokens: toolNodeInputTokens,
|
||||
outputTokens: toolNodeOutputTokens
|
||||
},
|
||||
// 工具的消耗
|
||||
...flatUsages
|
||||
|
||||
@@ -115,7 +115,8 @@ export const runToolWithPromptCall = async (
|
||||
|
||||
return {
|
||||
dispatchFlowResponse: [toolRunResponse],
|
||||
toolNodeTokens: 0,
|
||||
toolNodeInputTokens: 0,
|
||||
toolNodeOutputTokens: 0,
|
||||
completeMessages: concatMessages,
|
||||
assistantResponses: toolRunResponse.assistantResponses,
|
||||
runTimes: toolRunResponse.runTimes,
|
||||
@@ -131,7 +132,8 @@ export const runToolWithPromptCall = async (
|
||||
},
|
||||
{
|
||||
dispatchFlowResponse: [toolRunResponse],
|
||||
toolNodeTokens: 0,
|
||||
toolNodeInputTokens: 0,
|
||||
toolNodeOutputTokens: 0,
|
||||
assistantResponses: toolRunResponse.assistantResponses,
|
||||
runTimes: toolRunResponse.runTimes
|
||||
}
|
||||
@@ -286,15 +288,20 @@ export const runToolWithPromptCall = async (
|
||||
content: replaceAnswer
|
||||
};
|
||||
const completeMessages = filterMessages.concat(gptAssistantResponse);
|
||||
const tokens = await countGptMessagesTokens(completeMessages, undefined);
|
||||
// console.log(tokens, 'response token');
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages);
|
||||
const outputTokens = await countGptMessagesTokens([gptAssistantResponse]);
|
||||
|
||||
// concat tool assistant
|
||||
const toolNodeAssistant = GPTMessages2Chats([gptAssistantResponse])[0] as AIChatItemType;
|
||||
|
||||
return {
|
||||
dispatchFlowResponse: response?.dispatchFlowResponse || [],
|
||||
toolNodeTokens: response?.toolNodeTokens ? response.toolNodeTokens + tokens : tokens,
|
||||
toolNodeInputTokens: response?.toolNodeInputTokens
|
||||
? response.toolNodeInputTokens + inputTokens
|
||||
: inputTokens,
|
||||
toolNodeOutputTokens: response?.toolNodeOutputTokens
|
||||
? response.toolNodeOutputTokens + outputTokens
|
||||
: outputTokens,
|
||||
completeMessages,
|
||||
assistantResponses: [...assistantResponses, ...toolNodeAssistant.value],
|
||||
runTimes: (response?.runTimes || 0) + 1
|
||||
@@ -366,17 +373,9 @@ export const runToolWithPromptCall = async (
|
||||
function_call: toolJson
|
||||
};
|
||||
|
||||
/*
|
||||
...
|
||||
user
|
||||
assistant: tool data
|
||||
*/
|
||||
const concatToolMessages = [
|
||||
...requestMessages,
|
||||
assistantToolMsgParams
|
||||
] as ChatCompletionMessageParam[];
|
||||
// Only toolCall tokens are counted here, Tool response tokens count towards the next reply
|
||||
const tokens = await countGptMessagesTokens(concatToolMessages, undefined);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages);
|
||||
const outputTokens = await countGptMessagesTokens([assistantToolMsgParams]);
|
||||
|
||||
/*
|
||||
...
|
||||
@@ -437,7 +436,12 @@ ANSWER: `;
|
||||
}
|
||||
|
||||
const runTimes = (response?.runTimes || 0) + toolsRunResponse.toolResponse.runTimes;
|
||||
const toolNodeTokens = response?.toolNodeTokens ? response.toolNodeTokens + tokens : tokens;
|
||||
const toolNodeInputTokens = response?.toolNodeInputTokens
|
||||
? response.toolNodeInputTokens + inputTokens
|
||||
: inputTokens;
|
||||
const toolNodeOutputTokens = response?.toolNodeOutputTokens
|
||||
? response.toolNodeOutputTokens + outputTokens
|
||||
: outputTokens;
|
||||
|
||||
// Check stop signal
|
||||
const hasStopSignal = toolsRunResponse.toolResponse.flowResponses.some((item) => !!item.toolStop);
|
||||
@@ -460,7 +464,8 @@ ANSWER: `;
|
||||
|
||||
return {
|
||||
dispatchFlowResponse,
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
completeMessages: filterMessages,
|
||||
assistantResponses: toolNodeAssistants,
|
||||
runTimes,
|
||||
@@ -475,7 +480,8 @@ ANSWER: `;
|
||||
},
|
||||
{
|
||||
dispatchFlowResponse,
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
assistantResponses: toolNodeAssistants,
|
||||
runTimes
|
||||
}
|
||||
|
||||
@@ -27,9 +27,10 @@ import { getNanoid, sliceStrStartEnd } from '@fastgpt/global/common/string/tools
|
||||
import { toolValueTypeList } from '@fastgpt/global/core/workflow/constants';
|
||||
import { WorkflowInteractiveResponseType } from '@fastgpt/global/core/workflow/template/system/interactive/type';
|
||||
import { ChatItemValueTypeEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
|
||||
type ToolRunResponseType = {
|
||||
toolRunResponse: DispatchFlowResponse;
|
||||
toolRunResponse?: DispatchFlowResponse;
|
||||
toolMsgParams: ChatCompletionToolMessageParam;
|
||||
}[];
|
||||
|
||||
@@ -158,7 +159,8 @@ export const runToolWithToolChoice = async (
|
||||
|
||||
return {
|
||||
dispatchFlowResponse: [toolRunResponse],
|
||||
toolNodeTokens: 0,
|
||||
toolNodeInputTokens: 0,
|
||||
toolNodeOutputTokens: 0,
|
||||
completeMessages: requestMessages,
|
||||
assistantResponses: toolRunResponse.assistantResponses,
|
||||
runTimes: toolRunResponse.runTimes,
|
||||
@@ -176,7 +178,8 @@ export const runToolWithToolChoice = async (
|
||||
},
|
||||
{
|
||||
dispatchFlowResponse: [toolRunResponse],
|
||||
toolNodeTokens: 0,
|
||||
toolNodeInputTokens: 0,
|
||||
toolNodeOutputTokens: 0,
|
||||
assistantResponses: toolRunResponse.assistantResponses,
|
||||
runTimes: toolRunResponse.runTimes
|
||||
}
|
||||
@@ -342,59 +345,87 @@ export const runToolWithToolChoice = async (
|
||||
return Promise.reject(getEmptyResponseTip());
|
||||
}
|
||||
|
||||
// Run the selected tool by LLM.
|
||||
const toolsRunResponse = (
|
||||
await Promise.all(
|
||||
toolCalls.map(async (tool) => {
|
||||
const toolNode = toolNodes.find((item) => item.nodeId === tool.function?.name);
|
||||
/* Run the selected tool by LLM.
|
||||
Since only reference parameters are passed, if the same tool is run in parallel, it will get the same run parameters
|
||||
*/
|
||||
const toolsRunResponse: ToolRunResponseType = [];
|
||||
for await (const tool of toolCalls) {
|
||||
try {
|
||||
const toolNode = toolNodes.find((item) => item.nodeId === tool.function?.name);
|
||||
|
||||
if (!toolNode) return;
|
||||
if (!toolNode) continue;
|
||||
|
||||
const startParams = (() => {
|
||||
try {
|
||||
return json5.parse(tool.function.arguments);
|
||||
} catch (error) {
|
||||
return {};
|
||||
const startParams = (() => {
|
||||
try {
|
||||
return json5.parse(tool.function.arguments);
|
||||
} catch (error) {
|
||||
return {};
|
||||
}
|
||||
})();
|
||||
|
||||
initToolNodes(runtimeNodes, [toolNode.nodeId], startParams);
|
||||
const toolRunResponse = await dispatchWorkFlow({
|
||||
...workflowProps,
|
||||
isToolCall: true
|
||||
});
|
||||
|
||||
const stringToolResponse = formatToolResponse(toolRunResponse.toolResponses);
|
||||
|
||||
const toolMsgParams: ChatCompletionToolMessageParam = {
|
||||
tool_call_id: tool.id,
|
||||
role: ChatCompletionRequestMessageRoleEnum.Tool,
|
||||
name: tool.function.name,
|
||||
content: stringToolResponse
|
||||
};
|
||||
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.toolResponse,
|
||||
data: {
|
||||
tool: {
|
||||
id: tool.id,
|
||||
toolName: '',
|
||||
toolAvatar: '',
|
||||
params: '',
|
||||
response: sliceStrStartEnd(stringToolResponse, 5000, 5000)
|
||||
}
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
initToolNodes(runtimeNodes, [toolNode.nodeId], startParams);
|
||||
const toolRunResponse = await dispatchWorkFlow({
|
||||
...workflowProps,
|
||||
isToolCall: true
|
||||
});
|
||||
toolsRunResponse.push({
|
||||
toolRunResponse,
|
||||
toolMsgParams
|
||||
});
|
||||
} catch (error) {
|
||||
const err = getErrText(error);
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.toolResponse,
|
||||
data: {
|
||||
tool: {
|
||||
id: tool.id,
|
||||
toolName: '',
|
||||
toolAvatar: '',
|
||||
params: '',
|
||||
response: sliceStrStartEnd(err, 5000, 5000)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const stringToolResponse = formatToolResponse(toolRunResponse.toolResponses);
|
||||
|
||||
const toolMsgParams: ChatCompletionToolMessageParam = {
|
||||
toolsRunResponse.push({
|
||||
toolRunResponse: undefined,
|
||||
toolMsgParams: {
|
||||
tool_call_id: tool.id,
|
||||
role: ChatCompletionRequestMessageRoleEnum.Tool,
|
||||
name: tool.function.name,
|
||||
content: stringToolResponse
|
||||
};
|
||||
content: sliceStrStartEnd(err, 5000, 5000)
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
workflowStreamResponse?.({
|
||||
event: SseResponseEventEnum.toolResponse,
|
||||
data: {
|
||||
tool: {
|
||||
id: tool.id,
|
||||
toolName: '',
|
||||
toolAvatar: '',
|
||||
params: '',
|
||||
response: sliceStrStartEnd(stringToolResponse, 5000, 5000)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
toolRunResponse,
|
||||
toolMsgParams
|
||||
};
|
||||
})
|
||||
)
|
||||
).filter(Boolean) as ToolRunResponseType;
|
||||
|
||||
const flatToolsResponseData = toolsRunResponse.map((item) => item.toolRunResponse).flat();
|
||||
const flatToolsResponseData = toolsRunResponse
|
||||
.map((item) => item.toolRunResponse)
|
||||
.flat()
|
||||
.filter(Boolean) as DispatchFlowResponse[];
|
||||
// concat tool responses
|
||||
const dispatchFlowResponse = response
|
||||
? response.dispatchFlowResponse.concat(flatToolsResponseData)
|
||||
@@ -428,24 +459,26 @@ export const runToolWithToolChoice = async (
|
||||
] as ChatCompletionMessageParam[];
|
||||
|
||||
// Only toolCall tokens are counted here, Tool response tokens count towards the next reply
|
||||
const tokens = await countGptMessagesTokens(concatToolMessages, tools);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages, tools);
|
||||
const outputTokens = await countGptMessagesTokens(assistantToolMsgParams);
|
||||
|
||||
/*
|
||||
...
|
||||
user
|
||||
assistant: tool data
|
||||
tool: tool response
|
||||
*/
|
||||
...
|
||||
user
|
||||
assistant: tool data
|
||||
tool: tool response
|
||||
*/
|
||||
const completeMessages = [
|
||||
...concatToolMessages,
|
||||
...toolsRunResponse.map((item) => item?.toolMsgParams)
|
||||
];
|
||||
|
||||
/*
|
||||
Get tool node assistant response
|
||||
history assistant
|
||||
current tool assistant
|
||||
tool child assistant
|
||||
*/
|
||||
Get tool node assistant response
|
||||
history assistant
|
||||
current tool assistant
|
||||
tool child assistant
|
||||
*/
|
||||
const toolNodeAssistant = GPTMessages2Chats([
|
||||
...assistantToolMsgParams,
|
||||
...toolsRunResponse.map((item) => item?.toolMsgParams)
|
||||
@@ -463,7 +496,10 @@ export const runToolWithToolChoice = async (
|
||||
const runTimes =
|
||||
(response?.runTimes || 0) +
|
||||
flatToolsResponseData.reduce((sum, item) => sum + item.runTimes, 0);
|
||||
const toolNodeTokens = response ? response.toolNodeTokens + tokens : tokens;
|
||||
const toolNodeInputTokens = response ? response.toolNodeInputTokens + inputTokens : inputTokens;
|
||||
const toolNodeOutputTokens = response
|
||||
? response.toolNodeOutputTokens + outputTokens
|
||||
: outputTokens;
|
||||
|
||||
// Check stop signal
|
||||
const hasStopSignal = flatToolsResponseData.some(
|
||||
@@ -471,12 +507,12 @@ export const runToolWithToolChoice = async (
|
||||
);
|
||||
// Check interactive response(Only 1 interaction is reserved)
|
||||
const workflowInteractiveResponseItem = toolsRunResponse.find(
|
||||
(item) => item.toolRunResponse.workflowInteractiveResponse
|
||||
(item) => item.toolRunResponse?.workflowInteractiveResponse
|
||||
);
|
||||
if (hasStopSignal || workflowInteractiveResponseItem) {
|
||||
// Get interactive tool data
|
||||
const workflowInteractiveResponse =
|
||||
workflowInteractiveResponseItem?.toolRunResponse.workflowInteractiveResponse;
|
||||
workflowInteractiveResponseItem?.toolRunResponse?.workflowInteractiveResponse;
|
||||
|
||||
// Flashback traverses completeMessages, intercepting messages that know the first user
|
||||
const firstUserIndex = completeMessages.findLastIndex((item) => item.role === 'user');
|
||||
@@ -496,7 +532,8 @@ export const runToolWithToolChoice = async (
|
||||
|
||||
return {
|
||||
dispatchFlowResponse,
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
completeMessages,
|
||||
assistantResponses: toolNodeAssistants,
|
||||
runTimes,
|
||||
@@ -512,7 +549,8 @@ export const runToolWithToolChoice = async (
|
||||
},
|
||||
{
|
||||
dispatchFlowResponse,
|
||||
toolNodeTokens,
|
||||
toolNodeInputTokens,
|
||||
toolNodeOutputTokens,
|
||||
assistantResponses: toolNodeAssistants,
|
||||
runTimes
|
||||
}
|
||||
@@ -524,14 +562,17 @@ export const runToolWithToolChoice = async (
|
||||
content: answer
|
||||
};
|
||||
const completeMessages = filterMessages.concat(gptAssistantResponse);
|
||||
const tokens = await countGptMessagesTokens(completeMessages, tools);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages, tools);
|
||||
const outputTokens = await countGptMessagesTokens([gptAssistantResponse]);
|
||||
|
||||
// concat tool assistant
|
||||
const toolNodeAssistant = GPTMessages2Chats([gptAssistantResponse])[0] as AIChatItemType;
|
||||
|
||||
return {
|
||||
dispatchFlowResponse: response?.dispatchFlowResponse || [],
|
||||
toolNodeTokens: response ? response.toolNodeTokens + tokens : tokens,
|
||||
toolNodeInputTokens: response ? response.toolNodeInputTokens + inputTokens : inputTokens,
|
||||
toolNodeOutputTokens: response ? response.toolNodeOutputTokens + outputTokens : outputTokens,
|
||||
|
||||
completeMessages,
|
||||
assistantResponses: [...assistantResponses, ...toolNodeAssistant.value],
|
||||
runTimes: (response?.runTimes || 0) + 1
|
||||
@@ -578,7 +619,8 @@ async function streamResponse({
|
||||
text: content
|
||||
})
|
||||
});
|
||||
} else if (responseChoice?.tool_calls?.[0]) {
|
||||
}
|
||||
if (responseChoice?.tool_calls?.[0]) {
|
||||
const toolCall: ChatCompletionMessageToolCall = responseChoice.tool_calls[0];
|
||||
// In a stream response, only one tool is returned at a time. If have id, description is executing a tool
|
||||
if (toolCall.id || callingTool) {
|
||||
|
||||
@@ -31,7 +31,9 @@ export type DispatchToolModuleProps = ModuleDispatchProps<{
|
||||
|
||||
export type RunToolResponse = {
|
||||
dispatchFlowResponse: DispatchFlowResponse[];
|
||||
toolNodeTokens: number;
|
||||
toolNodeTokens?: number; // deprecated
|
||||
toolNodeInputTokens: number;
|
||||
toolNodeOutputTokens: number;
|
||||
completeMessages?: ChatCompletionMessageParam[];
|
||||
assistantResponses?: AIChatItemValueItemType[];
|
||||
toolWorkflowInteractiveResponse?: WorkflowInteractiveResponseType;
|
||||
|
||||
@@ -5,13 +5,17 @@ import { ChatRoleEnum } from '@fastgpt/global/core/chat/constants';
|
||||
import { SseResponseEventEnum } from '@fastgpt/global/core/workflow/runtime/constants';
|
||||
import { textAdaptGptResponse } from '@fastgpt/global/core/workflow/runtime/utils';
|
||||
import { createChatCompletion } from '../../../ai/config';
|
||||
import type { ChatCompletion, StreamChatType } from '@fastgpt/global/core/ai/type.d';
|
||||
import type {
|
||||
ChatCompletion,
|
||||
ChatCompletionMessageParam,
|
||||
StreamChatType
|
||||
} from '@fastgpt/global/core/ai/type.d';
|
||||
import { formatModelChars2Points } from '../../../../support/wallet/usage/utils';
|
||||
import type { LLMModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||
import { postTextCensor } from '../../../../common/api/requestPlusApi';
|
||||
import { ChatCompletionRequestMessageRoleEnum } from '@fastgpt/global/core/ai/constants';
|
||||
import type { DispatchNodeResultType } from '@fastgpt/global/core/workflow/runtime/type';
|
||||
import { countMessagesTokens } from '../../../../common/string/tiktoken/index';
|
||||
import { countGptMessagesTokens } from '../../../../common/string/tiktoken/index';
|
||||
import {
|
||||
chats2GPTMessages,
|
||||
chatValue2RuntimePrompt,
|
||||
@@ -214,16 +218,23 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
return Promise.reject(getEmptyResponseTip());
|
||||
}
|
||||
|
||||
const completeMessages = requestMessages.concat({
|
||||
role: ChatCompletionRequestMessageRoleEnum.Assistant,
|
||||
content: answerText
|
||||
});
|
||||
const AIMessages: ChatCompletionMessageParam[] = [
|
||||
{
|
||||
role: ChatCompletionRequestMessageRoleEnum.Assistant,
|
||||
content: answerText
|
||||
}
|
||||
];
|
||||
|
||||
const completeMessages = [...requestMessages, ...AIMessages];
|
||||
const chatCompleteMessages = GPTMessages2Chats(completeMessages);
|
||||
|
||||
const tokens = await countMessagesTokens(chatCompleteMessages);
|
||||
const inputTokens = await countGptMessagesTokens(requestMessages);
|
||||
const outputTokens = await countGptMessagesTokens(AIMessages);
|
||||
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model,
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
|
||||
@@ -232,7 +243,9 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens,
|
||||
tokens: inputTokens + outputTokens,
|
||||
inputTokens: inputTokens,
|
||||
outputTokens: outputTokens,
|
||||
query: `${userChatInput}`,
|
||||
maxToken: max_tokens,
|
||||
historyPreview: getHistoryPreview(
|
||||
@@ -247,7 +260,8 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
||||
moduleName: name,
|
||||
totalPoints: externalProvider.openaiAccount?.key ? 0 : totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
inputTokens: inputTokens,
|
||||
outputTokens: outputTokens
|
||||
}
|
||||
],
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: answerText,
|
||||
|
||||
@@ -120,14 +120,14 @@ export async function dispatchDatasetSearch(
|
||||
// vector
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model: vectorModel.model,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
modelType: ModelTypeEnum.vector
|
||||
});
|
||||
const responseData: DispatchNodeResponseType & { totalPoints: number } = {
|
||||
totalPoints,
|
||||
query: concatQueries.join('\n'),
|
||||
model: modelName,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
similarity: usingSimilarityFilter ? similarity : undefined,
|
||||
limit,
|
||||
searchMode,
|
||||
@@ -139,19 +139,21 @@ export async function dispatchDatasetSearch(
|
||||
totalPoints,
|
||||
moduleName: node.name,
|
||||
model: modelName,
|
||||
tokens
|
||||
inputTokens: tokens
|
||||
}
|
||||
];
|
||||
|
||||
if (aiExtensionResult) {
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model: aiExtensionResult.model,
|
||||
tokens: aiExtensionResult.tokens,
|
||||
inputTokens: aiExtensionResult.inputTokens,
|
||||
outputTokens: aiExtensionResult.outputTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
|
||||
responseData.totalPoints += totalPoints;
|
||||
responseData.tokens = aiExtensionResult.tokens;
|
||||
responseData.inputTokens = aiExtensionResult.inputTokens;
|
||||
responseData.outputTokens = aiExtensionResult.outputTokens;
|
||||
responseData.extensionModel = modelName;
|
||||
responseData.extensionResult =
|
||||
aiExtensionResult.extensionQueries?.join('\n') ||
|
||||
@@ -161,7 +163,8 @@ export async function dispatchDatasetSearch(
|
||||
totalPoints,
|
||||
moduleName: 'core.module.template.Query extension',
|
||||
model: modelName,
|
||||
tokens: aiExtensionResult.tokens
|
||||
inputTokens: aiExtensionResult.inputTokens,
|
||||
outputTokens: aiExtensionResult.outputTokens
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ import { dispatchLoopEnd } from './loop/runLoopEnd';
|
||||
import { dispatchLoopStart } from './loop/runLoopStart';
|
||||
import { dispatchFormInput } from './interactive/formInput';
|
||||
import { dispatchToolParams } from './agent/runTool/toolParams';
|
||||
import { getErrText } from '@fastgpt/global/common/error/utils';
|
||||
|
||||
const callbackMap: Record<FlowNodeTypeEnum, Function> = {
|
||||
[FlowNodeTypeEnum.workflowStart]: dispatchWorkflowStart,
|
||||
@@ -231,9 +232,7 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
|
||||
if (toolResponses !== undefined) {
|
||||
if (Array.isArray(toolResponses) && toolResponses.length === 0) return;
|
||||
if (typeof toolResponses === 'object' && Object.keys(toolResponses).length === 0) {
|
||||
return;
|
||||
}
|
||||
if (typeof toolResponses === 'object' && Object.keys(toolResponses).length === 0) return;
|
||||
toolRunResponse = toolResponses;
|
||||
}
|
||||
|
||||
@@ -565,6 +564,8 @@ export async function dispatchWorkFlow(data: Props): Promise<DispatchFlowRespons
|
||||
const targetEdges = runtimeEdges.filter((item) => item.source === node.nodeId);
|
||||
const skipHandleIds = targetEdges.map((item) => item.sourceHandle);
|
||||
|
||||
toolRunResponse = getErrText(error);
|
||||
|
||||
// Skip all edges and return error
|
||||
return {
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
|
||||
@@ -130,8 +130,7 @@ export const dispatchRunPlugin = async (props: RunPluginProps): Promise<RunPlugi
|
||||
[DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [
|
||||
{
|
||||
moduleName: plugin.name,
|
||||
totalPoints: usagePoints,
|
||||
tokens: 0
|
||||
totalPoints: usagePoints
|
||||
}
|
||||
],
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: output?.pluginOutput
|
||||
|
||||
@@ -153,8 +153,7 @@ export const dispatchRunAppNode = async (props: Props): Promise<Response> => {
|
||||
[DispatchNodeResponseKeyEnum.nodeDispatchUsages]: [
|
||||
{
|
||||
moduleName: appData.name,
|
||||
totalPoints: usagePoints,
|
||||
tokens: 0
|
||||
totalPoints: usagePoints
|
||||
}
|
||||
],
|
||||
[DispatchNodeResponseKeyEnum.toolResponses]: text,
|
||||
|
||||
@@ -31,7 +31,7 @@ export const dispatchQueryExtension = async ({
|
||||
const queryExtensionModel = getLLMModel(model);
|
||||
const chatHistories = getHistories(history, histories);
|
||||
|
||||
const { extensionQueries, tokens } = await queryExtension({
|
||||
const { extensionQueries, inputTokens, outputTokens } = await queryExtension({
|
||||
chatBg: systemPrompt,
|
||||
query: userChatInput,
|
||||
histories: chatHistories,
|
||||
@@ -42,7 +42,8 @@ export const dispatchQueryExtension = async ({
|
||||
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model: queryExtensionModel.model,
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
|
||||
@@ -59,7 +60,8 @@ export const dispatchQueryExtension = async ({
|
||||
[DispatchNodeResponseKeyEnum.nodeResponse]: {
|
||||
totalPoints,
|
||||
model: modelName,
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
query: userChatInput,
|
||||
textOutput: JSON.stringify(filterSameQueries)
|
||||
},
|
||||
@@ -68,7 +70,8 @@ export const dispatchQueryExtension = async ({
|
||||
moduleName: node.name,
|
||||
totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
inputTokens,
|
||||
outputTokens
|
||||
}
|
||||
],
|
||||
[NodeOutputKeyEnum.text]: JSON.stringify(filterSameQueries)
|
||||
|
||||
@@ -31,20 +31,23 @@ export const createTrainingUsage = async ({
|
||||
{
|
||||
moduleName: 'support.wallet.moduleName.index',
|
||||
model: vectorModel,
|
||||
tokens: 0,
|
||||
amount: 0
|
||||
amount: 0,
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
},
|
||||
{
|
||||
moduleName: 'support.wallet.moduleName.qa',
|
||||
model: agentModel,
|
||||
tokens: 0,
|
||||
amount: 0
|
||||
amount: 0,
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
},
|
||||
{
|
||||
moduleName: 'core.dataset.training.Auto mode',
|
||||
model: agentModel,
|
||||
tokens: 0,
|
||||
amount: 0
|
||||
amount: 0,
|
||||
inputTokens: 0,
|
||||
outputTokens: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
const { Schema } = connectionMongo;
|
||||
import { UsageSchemaType } from '@fastgpt/global/support/wallet/usage/type';
|
||||
import { UsageSourceMap } from '@fastgpt/global/support/wallet/usage/constants';
|
||||
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
|
||||
import {
|
||||
TeamCollectionName,
|
||||
TeamMemberCollectionName
|
||||
@@ -22,7 +22,7 @@ const UsageSchema = new Schema({
|
||||
},
|
||||
source: {
|
||||
type: String,
|
||||
enum: Object.keys(UsageSourceMap),
|
||||
enum: Object.values(UsageSourceEnum),
|
||||
required: true
|
||||
},
|
||||
appName: {
|
||||
@@ -65,7 +65,7 @@ try {
|
||||
// timer task. clear dead team
|
||||
// UsageSchema.index({ teamId: 1, time: -1 }, { background: true });
|
||||
|
||||
UsageSchema.index({ time: 1 }, { background: true, expireAfterSeconds: 720 * 24 * 60 * 60 });
|
||||
UsageSchema.index({ time: 1 }, { background: true, expireAfterSeconds: 360 * 24 * 60 * 60 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import { LLMModelItemType } from '@fastgpt/global/core/ai/model.d';
|
||||
import { ModelTypeEnum, getModelMap } from '../../../core/ai/model';
|
||||
|
||||
export const formatModelChars2Points = ({
|
||||
model,
|
||||
tokens = 0,
|
||||
inputTokens = 0,
|
||||
outputTokens = 0,
|
||||
modelType,
|
||||
multiple = 1000
|
||||
}: {
|
||||
model: string;
|
||||
tokens: number;
|
||||
inputTokens?: number;
|
||||
outputTokens?: number;
|
||||
modelType: `${ModelTypeEnum}`;
|
||||
multiple?: number;
|
||||
}) => {
|
||||
const modelData = getModelMap?.[modelType]?.(model);
|
||||
const modelData = getModelMap?.[modelType]?.(model) as LLMModelItemType;
|
||||
if (!modelData) {
|
||||
return {
|
||||
totalPoints: 0,
|
||||
@@ -19,7 +22,12 @@ export const formatModelChars2Points = ({
|
||||
};
|
||||
}
|
||||
|
||||
const totalPoints = (modelData.charsPointsPrice || 0) * (tokens / multiple);
|
||||
const isIOPriceType = typeof modelData.inputPrice === 'number';
|
||||
|
||||
const totalPoints = isIOPriceType
|
||||
? (modelData.inputPrice || 0) * (inputTokens / multiple) +
|
||||
(modelData.outputPrice || 0) * (outputTokens / multiple)
|
||||
: (modelData.charsPointsPrice || 0) * ((inputTokens + outputTokens) / multiple);
|
||||
|
||||
return {
|
||||
modelName: modelData.name,
|
||||
|
||||
1
packages/service/type.d.ts
vendored
@@ -18,6 +18,7 @@ declare global {
|
||||
var subPlans: SubPlanType | undefined;
|
||||
|
||||
var llmModels: LLMModelItemType[];
|
||||
var llmModelPriceType: 'IO' | 'Tokens';
|
||||
var vectorModels: VectorModelItemType[];
|
||||
var audioSpeechModels: AudioSpeechModelType[];
|
||||
var whisperModel: STTModelType;
|
||||
|
||||
@@ -357,16 +357,20 @@ export const iconPaths = {
|
||||
'modal/selectSource': () => import('./icons/modal/selectSource.svg'),
|
||||
'modal/setting': () => import('./icons/modal/setting.svg'),
|
||||
'modal/teamPlans': () => import('./icons/modal/teamPlans.svg'),
|
||||
'model/BAAI': () => import('./icons/model/BAAI.svg'),
|
||||
'model/alicloud': () => import('./icons/model/alicloud.svg'),
|
||||
'model/baichuan': () => import('./icons/model/baichuan.svg'),
|
||||
'model/chatglm': () => import('./icons/model/chatglm.svg'),
|
||||
'model/claude': () => import('./icons/model/claude.svg'),
|
||||
'model/deepseek': () => import('./icons/model/deepseek.svg'),
|
||||
'model/doubao': () => import('./icons/model/doubao.svg'),
|
||||
'model/ernie': () => import('./icons/model/ernie.svg'),
|
||||
'model/fishaudio': () => import('./icons/model/fishaudio.svg'),
|
||||
'model/gemini': () => import('./icons/model/gemini.svg'),
|
||||
'model/groq': () => import('./icons/model/groq.svg'),
|
||||
'model/huggingface': () => import('./icons/model/huggingface.svg'),
|
||||
'model/hunyuan': () => import('./icons/model/hunyuan.svg'),
|
||||
'model/meta': () => import('./icons/model/meta.svg'),
|
||||
'model/minimax': () => import('./icons/model/minimax.svg'),
|
||||
'model/mistral': () => import('./icons/model/mistral.svg'),
|
||||
'model/moonshot': () => import('./icons/model/moonshot.svg'),
|
||||
@@ -374,6 +378,7 @@ export const iconPaths = {
|
||||
'model/openai': () => import('./icons/model/openai.svg'),
|
||||
'model/qwen': () => import('./icons/model/qwen.svg'),
|
||||
'model/sparkDesk': () => import('./icons/model/sparkDesk.svg'),
|
||||
'model/stepfun': () => import('./icons/model/stepfun.svg'),
|
||||
'model/yi': () => import('./icons/model/yi.svg'),
|
||||
more: () => import('./icons/more.svg'),
|
||||
moreLine: () => import('./icons/moreLine.svg'),
|
||||
|
||||
3
packages/web/components/common/Icon/icons/model/BAAI.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.8421 18.067L13.3433 29.38H17.1204L19.8133 21.8408L22.501 29.38H26.3705L21.8759 18.067H17.8421ZM43.9918 29.3552H47.6953V18.0419H43.9918V29.3552ZM10.4405 24.3003C10.0338 23.8233 9.568 23.4314 8.70827 23.2344C9.27395 23.0491 9.53849 22.8553 9.82969 22.5371C10.2706 22.0593 10.4939 21.4839 10.4939 20.8153C10.4939 20.0204 10.182 19.351 9.56515 18.8106C8.94862 18.272 8.06187 18 6.9088 18H0.000355556V20.4788H6.01067C6.01067 20.4788 6.94436 20.5244 6.93084 21.4074C6.9184 22.3645 5.984 22.3543 5.984 22.3543H0V24.8418H5.5936C5.99716 24.8418 6.63893 24.7581 6.97067 25.0086C7.23307 25.2078 7.33938 25.3655 7.33938 25.6998C7.33938 26.0607 7.20924 26.3484 6.95004 26.5629C6.68764 26.7759 6.44516 26.8276 5.60249 26.8385H0.000355556V29.313H6.36907C6.64107 29.313 7.19431 29.2584 8.02738 29.1564C8.6528 29.0799 9.12035 28.9576 9.43004 28.7861C9.93244 28.5162 10.326 28.144 10.614 27.6761C10.902 27.2092 11.0464 26.6787 11.0464 26.0938C11.0464 25.3731 10.8427 24.7763 10.4405 24.3003ZM35.1371 21.7752L37.824 29.313H41.6949L37.1993 18H33.1652L28.6674 29.313H32.4434L35.1371 21.7752Z" fill="#231F20"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1735795333775" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4413" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M512 64a448 448 0 1 1 0 896A448 448 0 0 1 512 64z" fill="#FF6A00" p-id="4414"></path><path d="M324.8 602.624a26.752 26.752 0 0 1-21.312-25.92v-142.72a27.712 27.712 0 0 1 21.376-25.984l132.416-28.672 13.952-56.896H317.312a97.6 97.6 0 0 0-98.24 96.96v169.344c0.384 54.08 44.16 97.856 98.24 98.176h153.92l-13.888-56.512-132.544-27.776zM710.4 322.432c54.016 0.128 97.92 43.584 98.56 97.6v170.176a98.368 98.368 0 0 1-98.56 98.048H555.328l14.08-56.832 132.608-28.736a27.84 27.84 0 0 0 21.376-25.92v-142.72a26.88 26.88 0 0 0-21.376-25.984l-132.544-28.8-14.08-56.832zM570.368 497.92v13.952H457.28v-13.952h113.088z" fill="#FFFFFF" p-id="4415"></path></svg>
|
||||
|
After Width: | Height: | Size: 978 B |
@@ -0,0 +1,5 @@
|
||||
<svg viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="128" height="128" fill="white"/>
|
||||
<path opacity="0.35" fill-rule="evenodd" clip-rule="evenodd" d="M117.928 62.5487C119.067 62.5487 120 63.1367 120 63.8553V68.2933C120 69.012 119.067 69.6 117.928 69.6C116.789 69.6 115.856 69.012 115.856 68.2933V63.8507C115.856 63.1367 116.789 62.5487 117.928 62.5487ZM109.696 64.2847C110.835 64.2847 111.768 64.8727 111.768 65.5913V75.368C111.768 76.082 110.835 76.67 109.696 76.67C108.553 76.67 107.624 76.082 107.624 75.3633V65.5867C107.624 64.8727 108.557 64.2847 109.696 64.2847ZM101.459 66.31C102.598 66.31 103.531 66.8933 103.531 67.612V78.602C103.531 79.3207 102.598 79.9087 101.459 79.9087C100.321 79.9087 99.3873 79.3207 99.3873 78.602V67.612C99.3873 66.8933 100.321 66.31 101.459 66.31ZM93.2273 67.9853C94.366 67.9853 95.2993 68.5687 95.2993 69.2873V80.1607C95.2993 80.8747 94.366 81.4627 93.2273 81.4627C92.0886 81.4627 91.1553 80.8747 91.1553 80.156V69.2827C91.1553 68.5687 92.0886 67.9853 93.2273 67.9853ZM84.9906 69.46C86.134 69.46 87.0626 70.048 87.0626 70.7667V80.1793C87.0626 80.898 86.1293 81.486 84.9906 81.486C83.852 81.486 82.9186 80.898 82.9186 80.1793V70.7667C82.9186 70.048 83.852 69.46 84.9906 69.46ZM76.8006 75.466C77.9393 75.466 78.8726 76.0493 78.8726 76.7727V79.7593C78.8726 80.4733 77.9393 81.0567 76.8006 81.0567C75.662 81.0567 74.7286 80.4733 74.7286 79.7547V76.768C74.7286 76.0493 75.662 75.466 76.8006 75.466Z" fill="black"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M117.928 50.6067C119.067 50.6067 120 51.19 120 51.9087V59.2587C120 59.9773 119.067 60.5653 117.928 60.5653C116.789 60.5653 115.856 59.9773 115.856 59.2587V51.9087C115.856 51.19 116.789 50.602 117.928 50.602V50.6067ZM109.696 45.6693C110.835 45.6693 111.768 46.2527 111.768 46.976V60.0893C111.768 60.8033 110.835 61.3867 109.696 61.3867C108.553 61.3867 107.624 60.8033 107.624 60.0847V46.9713C107.624 46.2527 108.557 45.6693 109.696 45.6693ZM101.459 43.812C102.598 43.812 103.531 44.4 103.531 45.1187V62.2313C103.531 62.9453 102.598 63.538 101.459 63.538C100.321 63.538 99.3873 62.9453 99.3873 62.2313V45.114C99.3873 44.4 100.321 43.812 101.459 43.812ZM93.2273 43C94.366 43 95.2993 43.588 95.2993 44.3067V64.3267C95.2993 65.0453 94.366 65.6333 93.2273 65.6333C92.0887 65.6333 91.1553 65.0453 91.1553 64.3267V44.3067C91.1553 43.588 92.0887 43 93.2273 43ZM84.9907 43.5087C86.134 43.5087 87.0627 44.0967 87.0627 44.8153V65.1387C87.0627 65.8573 86.1293 66.4453 84.9907 66.4453C83.852 66.4453 82.9187 65.8573 82.9187 65.1387V44.8107C82.9187 44.0967 83.852 43.504 84.9907 43.504V43.5087ZM76.8007 44.7827C77.9393 44.7827 78.8727 45.366 78.8727 46.0893V71.448C78.8727 72.162 77.9393 72.7547 76.8007 72.7547C75.662 72.7547 74.7287 72.1667 74.7287 71.448V46.08C74.7287 45.3613 75.662 44.7733 76.8007 44.7733V44.7827ZM68.396 46.9433C69.5347 46.9433 70.468 47.5267 70.468 48.2453V77.0013C70.468 77.72 69.5347 78.308 68.396 78.308C67.2573 78.308 66.324 77.72 66.324 77.0013V48.2453C66.324 47.5267 67.2573 46.9387 68.396 46.9387V46.9433ZM60.164 50.602C61.3027 50.602 62.236 51.19 62.236 51.9087V79.5727C62.236 80.2913 61.3027 80.8793 60.164 80.8793C59.0207 80.8793 58.092 80.2913 58.092 79.5727V51.9087C58.092 51.19 59.0253 50.602 60.164 50.602ZM51.9273 55.3713C53.0707 55.3713 53.9993 55.9593 53.9993 56.678V80.7627C53.9993 81.4813 53.066 82.0693 51.9273 82.0693C50.7887 82.0693 49.8553 81.4813 49.8553 80.7627V56.6733C49.8553 55.9547 50.7887 55.3667 51.9273 55.3667V55.3713ZM43.6953 58.666C44.834 58.666 45.7673 59.254 45.7673 59.9727V83.698C45.7673 84.412 44.834 85 43.6953 85C42.5567 85 41.6233 84.412 41.6233 83.6933V59.9727C41.6233 59.254 42.5567 58.666 43.6953 58.666ZM35.5007 61.396C36.644 61.396 37.5727 61.984 37.5727 62.7027V75.326C37.5727 76.0447 36.6393 76.6327 35.5007 76.6327C34.362 76.6327 33.4287 76.0447 33.4287 75.326V62.698C33.4287 61.984 34.362 61.396 35.5007 61.396ZM27.0213 49.0853C28.16 49.0853 29.0933 49.6733 29.0933 50.392V67.99C29.0933 68.7087 28.16 69.2967 27.0213 69.2967C25.8827 69.2967 24.9493 68.7087 24.9493 67.99V50.392C24.9493 49.6733 25.8827 49.0853 27.0213 49.0853ZM18.556 50.238C19.6947 50.238 20.6233 50.826 20.6233 51.5447V56.958C20.6233 57.672 19.69 58.26 18.556 58.26C17.4127 58.26 16.484 57.672 16.484 56.9533V51.54C16.484 50.826 17.4173 50.238 18.556 50.238ZM10.072 49.51C11.2107 49.51 12.144 50.098 12.144 50.8167V53.2573C12.144 53.9713 11.2107 54.5593 10.072 54.5593C8.93333 54.5593 8 53.9713 8 53.2527V50.8167C8 50.098 8.93333 49.51 10.072 49.51ZM35.5053 47.4473C36.644 47.4473 37.5727 48.0353 37.5727 48.754V50.5833C37.5727 51.302 36.6393 51.89 35.5007 51.89C34.362 51.89 33.4287 51.302 33.4287 50.5833V48.7493C33.4287 48.0307 34.362 47.4427 35.5007 47.4427L35.5053 47.4473Z" fill="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.6 KiB |
77
packages/web/components/common/Icon/icons/model/meta.svg
Normal file
@@ -0,0 +1,77 @@
|
||||
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_28116_23027)">
|
||||
<path d="M13.7936 8H13.7456L13.6836 13.23H13.7276C17.1576 13.23 19.8196 15.944 25.6076 25.722L25.9576 26.316L25.9816 26.356L29.2216 21.48L29.1976 21.442C28.4896 20.2828 27.7574 19.1386 27.0016 18.01C26.2575 16.8963 25.4736 15.8096 24.6516 14.752C20.8256 9.864 17.6256 8 13.7936 8Z" fill="url(#paint0_linear_28116_23027)"/>
|
||||
<path d="M13.7455 8C9.89953 8.02 6.49353 10.516 4.03953 14.34C4.03284 14.3513 4.02617 14.3627 4.01953 14.374L8.52753 16.836L8.54953 16.802C9.98553 14.636 11.7695 13.254 13.6855 13.232H13.7275L13.7915 8H13.7455Z" fill="url(#paint1_linear_28116_23027)"/>
|
||||
<path d="M4.03906 14.3401L4.01706 14.3741C2.40106 16.8941 1.19706 19.9901 0.549062 23.3281L0.539062 23.3721L5.60706 24.5721L5.61506 24.5281C6.15506 21.5941 7.18706 18.8721 8.52706 16.8381L8.54906 16.8041L4.03906 14.3401Z" fill="url(#paint2_linear_28116_23027)"/>
|
||||
<path d="M5.614 24.5279L0.548 23.3279L0.538 23.3719C0.184 25.2079 0.004 27.0739 0 28.9439V28.9899L5.196 29.4559V29.4099C5.17709 27.7734 5.31776 26.139 5.616 24.5299L5.614 24.5279Z" fill="url(#paint3_linear_28116_23027)"/>
|
||||
<path d="M5.35425 31.074C5.26107 30.5367 5.20825 29.9932 5.19625 29.448V29.404L0.000246211 28.936V28.984C-0.00558496 30.0921 0.0921736 31.1982 0.292246 32.288L5.36225 31.118C5.35954 31.1034 5.35687 31.0887 5.35425 31.074Z" fill="url(#paint4_linear_28116_23027)"/>
|
||||
<path d="M6.54116 33.78C5.97316 33.16 5.57316 32.268 5.36316 31.124L5.35516 31.082L0.285156 32.252L0.293156 32.294C0.677156 34.314 1.42916 35.994 2.50516 37.268L2.53316 37.302L6.56916 33.812C6.5591 33.8014 6.5511 33.7907 6.54116 33.78Z" fill="url(#paint5_linear_28116_23027)"/>
|
||||
<path d="M21.5599 19.3081C18.5039 24.0081 16.6519 26.9581 16.6519 26.9581C12.5819 33.3581 11.1739 34.7921 8.90991 34.7921C8.46467 34.8037 8.02219 34.7189 7.61277 34.5436C7.20336 34.3682 6.8367 34.1064 6.53791 33.7761L2.50391 37.2641L2.53191 37.2981C4.01991 39.0361 6.11591 40.0001 8.71191 40.0001C12.6379 40.0001 15.4599 38.1441 20.4799 29.3401L24.0119 23.0801C23.2283 21.8007 22.412 20.5429 21.5599 19.3081Z" fill="#0082FB"/>
|
||||
<path d="M27.0043 11.8919L26.9723 11.9239C26.1723 12.7839 25.4003 13.7399 24.6523 14.7559C25.4083 15.7219 26.1883 16.8039 27.0023 18.0159C27.9623 16.5299 28.8583 15.3259 29.7363 14.4019L29.7683 14.3699L27.0043 11.8919Z" fill="url(#paint6_linear_28116_23027)"/>
|
||||
<path d="M41.8367 11.426C39.7067 9.266 37.1667 8 34.4507 8C31.5867 8 29.1767 9.574 27.0047 11.888L26.9727 11.92L29.7367 14.4L29.7687 14.366C31.1987 12.872 32.5847 12.126 34.1207 12.126C35.7727 12.126 37.3207 12.906 38.6607 14.276L38.6907 14.308L41.8687 11.458L41.8367 11.426Z" fill="#0082FB"/>
|
||||
<path d="M47.9962 28.25C47.8762 21.316 45.4562 15.118 41.8682 11.458L41.8362 11.426L38.6602 14.274L38.6902 14.306C41.3902 17.09 43.2442 22.266 43.4122 28.248V28.294H47.9962V28.25Z" fill="url(#paint7_linear_28116_23027)"/>
|
||||
<path d="M47.996 28.2999V28.2539H43.412V28.2979C43.42 28.5779 43.424 28.8619 43.424 29.1459C43.424 30.7759 43.182 32.0939 42.688 33.0459L42.666 33.0899L46.082 36.6539L46.108 36.6139C47.348 34.6939 48 32.0279 48 28.7939C48 28.6279 48 28.4639 47.996 28.2999Z" fill="url(#paint8_linear_28116_23027)"/>
|
||||
<path d="M42.688 33.04L42.666 33.08C42.238 33.884 41.628 34.42 40.832 34.654L42.388 39.578C42.6879 39.4767 42.9806 39.3551 43.264 39.214C44.3715 38.6542 45.3134 37.8144 45.996 36.778L46.084 36.648L46.108 36.608L42.688 33.04Z" fill="url(#paint9_linear_28116_23027)"/>
|
||||
<path d="M39.8406 34.7861C39.3166 34.7861 38.8566 34.7081 38.4046 34.5061L36.8086 39.5501C37.7066 39.8561 38.6626 39.9941 39.7286 39.9941C40.7126 39.9941 41.6146 39.8481 42.4326 39.5641L40.8726 34.6401C40.5386 34.7401 40.1926 34.7901 39.8406 34.7861Z" fill="url(#paint10_linear_28116_23027)"/>
|
||||
<path d="M36.6453 33.0679L36.6173 33.0339L32.9453 36.8619L32.9773 36.8959C34.2513 38.2599 35.4693 39.1059 36.8513 39.5699L38.4453 34.5299C37.8633 34.2799 37.2993 33.8239 36.6453 33.0679Z" fill="url(#paint11_linear_28116_23027)"/>
|
||||
<path d="M36.619 33.03C35.519 31.746 34.155 29.606 32.013 26.15L29.221 21.478L29.199 21.438L25.959 26.314L25.983 26.354L27.961 29.69C29.879 32.91 31.441 35.238 32.947 36.86L32.979 36.892L36.647 33.064C36.6376 33.0527 36.6283 33.0414 36.619 33.03Z" fill="url(#paint12_linear_28116_23027)"/>
|
||||
</g>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_28116_23027" x1="1192.97" y1="1645.34" x2="229.443" y2="378.706" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0006" stop-color="#0867DF"/>
|
||||
<stop offset="0.4539" stop-color="#0668E1"/>
|
||||
<stop offset="0.8591" stop-color="#0064E0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_28116_23027" x1="215.779" y1="678.423" x2="903.276" y2="155.167" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.1323" stop-color="#0064DF"/>
|
||||
<stop offset="0.9988" stop-color="#0064E0"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint2_linear_28116_23027" x1="307.026" y1="926.288" x2="587.306" y2="218.601" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0147" stop-color="#0072EC"/>
|
||||
<stop offset="0.6881" stop-color="#0064DF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint3_linear_28116_23027" x1="264.132" y1="576.012" x2="298.323" y2="120.222" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0731" stop-color="#007CF6"/>
|
||||
<stop offset="0.9943" stop-color="#0072EC"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint4_linear_28116_23027" x1="279.668" y1="224.361" x2="269.842" y2="151.011" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0731" stop-color="#007FF9"/>
|
||||
<stop offset="1" stop-color="#007CF6"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint5_linear_28116_23027" x1="237.123" y1="108.844" x2="387.116" y2="428.013" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0731" stop-color="#007FF9"/>
|
||||
<stop offset="1" stop-color="#0082FB"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint6_linear_28116_23027" x1="202.73" y1="433.72" x2="383.614" y2="182.812" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.2799" stop-color="#007FF8"/>
|
||||
<stop offset="0.9141" stop-color="#0082FB"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint7_linear_28116_23027" x1="447.222" y1="116.598" x2="849.003" y2="1599.3" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#0082FB"/>
|
||||
<stop offset="0.9995" stop-color="#0081FA"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint8_linear_28116_23027" x1="362.999" y1="67.4063" x2="127.282" y2="545.316" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0619" stop-color="#0081FA"/>
|
||||
<stop offset="1" stop-color="#0080F9"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint9_linear_28116_23027" x1="200.6" y1="420.874" x2="390.793" y2="290.929" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#027AF3"/>
|
||||
<stop offset="1" stop-color="#0080F9"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint10_linear_28116_23027" x1="151.724" y1="308.912" x2="498.607" y2="308.912" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#0377EF"/>
|
||||
<stop offset="0.9994" stop-color="#0279F1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint11_linear_28116_23027" x1="254.612" y1="263.742" x2="449.915" y2="379.036" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.0019" stop-color="#0471E9"/>
|
||||
<stop offset="1" stop-color="#0377EF"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint12_linear_28116_23027" x1="370.69" y1="326.175" x2="1008.64" y2="1130.72" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0.2765" stop-color="#0867DF"/>
|
||||
<stop offset="1" stop-color="#0471E9"/>
|
||||
</linearGradient>
|
||||
<clipPath id="clip0_28116_23027">
|
||||
<rect width="48" height="48" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.3 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="52" height="52" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd"><path style="opacity:.718" fill="#0080ff" d="M46.5-.5h3c0 1.333.667 2 2 2v3c-1.676.683-2.343 2.017-2 4h-3v-4c-.427-1.238-.427-2.238 0-3v-2z"/><path style="opacity:.596" fill="#0084ff" d="M46.5 1.5c-.427.762-.427 1.762 0 3h-4v-3h4z"/><path style="opacity:.605" fill="#009dff" d="M7.5 4.5a10.173 10.173 0 0 0-3 3v-4c1.291-.237 2.291.096 3 1z"/><path style="opacity:.749" fill="#09f" d="M7.5 4.5v10a5.728 5.728 0 0 1-3-1v-6a10.173 10.173 0 0 1 3-3z"/><path style="opacity:.741" fill="#0196ff" d="M15.5 6.5a303.97 303.97 0 0 1-4 3v-3h4z"/><path style="opacity:.938" fill="#0091ff" d="M15.5 6.5h8c-1.965 2.978-4.632 4.978-8 6v3h-4v-6a303.97 303.97 0 0 0 4-3z"/><path style="opacity:.963" fill="#008cff" d="M23.5 6.5h9a147.885 147.885 0 0 0-18.5 17c-.77-1.098-1.603-1.098-2.5 0v-8h4v-3c3.368-1.022 6.035-3.022 8-6z"/><path style="opacity:.932" fill="#0086ff" d="M32.5 6.5h10c-5.818 2.99-10.484 6.658-14 11h-6v5a109.794 109.794 0 0 1-11 9v-8c.897-1.098 1.73-1.098 2.5 0a147.885 147.885 0 0 1 18.5-17z"/><path style="opacity:.853" fill="#0080ff" d="M42.5 6.5h3v8a30.943 30.943 0 0 1-2-2 17.853 17.853 0 0 0-5 5h-10c3.516-4.342 8.182-8.01 14-11z"/><path style="opacity:.749" fill="#007aff" d="M45.5 14.5v3h-7a17.853 17.853 0 0 1 5-5c.682.743 1.349 1.41 2 2z"/><path style="opacity:.721" fill="#0092ff" d="M4.5 13.5c.891.61 1.891.943 3 1v7c-.617.11-1.117.444-1.5 1-.278-.916-.778-1.582-1.5-2v-7z"/><path style="opacity:.618" fill="#008dff" d="M4.5 20.5c.722.418 1.222 1.084 1.5 2 .383-.556.883-.89 1.5-1v6h-3v-7z"/><path style="opacity:.941" fill="#0080ff" d="M22.5 22.5v8A273.02 273.02 0 0 1 7.5 43c.556.383.89.883 1 1.5h-9v-3a19.582 19.582 0 0 1 6-4.5 18.492 18.492 0 0 0 2-3.5c1.983.343 3.317-.324 4-2a109.794 109.794 0 0 0 11-9z"/><path style="opacity:.693" fill="#0078ff" d="M35.5 27.5v1c-3.515.845-6.181 2.845-8 6v-7h8z"/><path style="opacity:.716" fill="#016eff" d="M35.5 28.5v-1h16v1c-1.527-.073-2.527.594-3 2h-8c.11-.617.444-1.117 1-1.5a18.436 18.436 0 0 0-6-.5z"/><path style="opacity:.967" fill="#0073ff" d="M35.5 28.5a18.436 18.436 0 0 1 6 .5c-.556.383-.89.883-1 1.5-.992-.172-1.658.162-2 1-3.85 2.76-7.517 5.76-11 9v-6c1.819-3.155 4.485-5.155 8-6z"/><path style="opacity:.874" fill="#0069ff" d="M51.5 28.5v2h-3c.473-1.406 1.473-2.073 3-2z"/><path style="opacity:.921" fill="#0079ff" d="M22.5 30.5v8c-2.938 1.122-4.938 3.122-6 6h-8c-.11-.617-.444-1.117-1-1.5a273.02 273.02 0 0 0 15-12.5z"/><path style="opacity:.924" fill="#006dff" d="M38.5 31.5v8a73.126 73.126 0 0 0-11 9v-8c3.483-3.24 7.15-6.24 11-9z"/><path style="opacity:.878" fill="#0085ff" d="M-.5 33.5h8a18.492 18.492 0 0 1-2 3.5 19.582 19.582 0 0 0-6 4.5v-8z"/><path style="opacity:.788" fill="#0074ff" d="M22.5 38.5v6h-6c1.062-2.878 3.062-4.878 6-6z"/><path style="opacity:.93" fill="#0067ff" d="M38.5 39.5v9c-2.212-.547-3.879.453-5 3h-6v-3a73.126 73.126 0 0 1 11-9z"/><path style="opacity:.883" fill="#0062ff" d="M38.5 48.5v3h-5c1.121-2.547 2.788-3.547 5-3z"/></svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -1,13 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
|
||||
<g clip-path="url(#clip0_12804_895)">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none">
|
||||
<g clip-path="url(#clip0_19_444)">
|
||||
<path d="M10 20C15.5229 20 20 15.5229 20 10C20 4.47712 15.5229 0 10 0C4.47712 0 0 4.47712 0 10C0 15.5229 4.47712 20 10 20Z" fill="#003425"/>
|
||||
<path d="M15.0706 12.0408C15.0706 11.8535 14.9962 11.6738 14.8637 11.5413C14.7312 11.4088 14.5515 11.3344 14.3642 11.3344C14.1768 11.3344 13.9972 11.4088 13.8647 11.5413C13.7322 11.6738 13.6578 11.8535 13.6578 12.0408V15.6829C13.6578 15.8702 13.7322 16.0499 13.8647 16.1824C13.9972 16.3149 14.1768 16.3893 14.3642 16.3893C14.5515 16.3893 14.7312 16.3149 14.8637 16.1824C14.9962 16.0499 15.0706 15.8702 15.0706 15.6829V12.0408Z" fill="white"/>
|
||||
<path d="M14.0669 4.44512C13.9962 4.38501 13.9144 4.33941 13.8261 4.31092C13.7378 4.28243 13.6448 4.27162 13.5523 4.27909C13.4598 4.28656 13.3697 4.31218 13.2872 4.35448C13.2046 4.39677 13.1312 4.45492 13.0711 4.5256L9.12338 9.16752C9.02527 9.28249 8.96681 9.426 8.95666 9.5768C8.95106 9.61248 8.94818 9.6488 8.94818 9.68608V15.6202C8.94818 15.8075 9.02261 15.9872 9.15508 16.1197C9.28756 16.2521 9.46723 16.3266 9.65458 16.3266C9.84193 16.3266 10.0216 16.2521 10.1541 16.1197C10.2866 15.9872 10.361 15.8075 10.361 15.6202V9.8928L14.1474 5.44096C14.2075 5.37029 14.2531 5.28847 14.2816 5.20018C14.3101 5.11189 14.3209 5.01885 14.3134 4.92637C14.3059 4.8339 14.2803 4.7438 14.238 4.66123C14.1957 4.57865 14.1376 4.50522 14.0669 4.44512Z" fill="white"/>
|
||||
<path d="M5.33953 4.12561C5.28072 4.05387 5.20835 3.99441 5.12656 3.95063C5.04477 3.90686 4.95516 3.87962 4.86285 3.87048C4.77053 3.86133 4.67732 3.87046 4.58853 3.89734C4.49974 3.92422 4.41711 3.96832 4.34537 4.02713C4.27363 4.08594 4.21417 4.15831 4.17039 4.2401C4.12662 4.32189 4.09938 4.4115 4.09023 4.50382C4.08109 4.59613 4.09022 4.68935 4.11709 4.77814C4.14397 4.86692 4.18808 4.94955 4.24689 5.02129L7.04401 8.43329C7.16278 8.57821 7.33426 8.67 7.52072 8.68849C7.70717 8.70697 7.89334 8.65063 8.03825 8.53185C8.18316 8.41308 8.27496 8.2416 8.29344 8.05515C8.31193 7.86869 8.25558 7.68253 8.13681 7.53761L5.33937 4.12561H5.33953Z" fill="white"/>
|
||||
<path d="M15.3376 10.1727C15.5666 10.1727 15.7862 10.0817 15.9482 9.91975C16.1101 9.75783 16.2011 9.53821 16.2011 9.30921C16.2011 9.08021 16.1101 8.86059 15.9482 8.69867C15.7862 8.53674 15.5666 8.44577 15.3376 8.44577C15.1086 8.44577 14.889 8.53674 14.7271 8.69867C14.5652 8.86059 14.4742 9.08021 14.4742 9.30921C14.4742 9.53821 14.5652 9.75783 14.7271 9.91975C14.889 10.0817 15.1086 10.1727 15.3376 10.1727Z" fill="#00FF25"/>
|
||||
<path d="M15.0705 12.0408C15.0705 11.8535 14.9961 11.6738 14.8636 11.5413C14.7311 11.4088 14.5515 11.3344 14.3641 11.3344C14.1768 11.3344 13.9971 11.4088 13.8646 11.5413C13.7321 11.6738 13.6577 11.8535 13.6577 12.0408V15.6829C13.6577 15.8702 13.7321 16.0499 13.8646 16.1824C13.9971 16.3149 14.1768 16.3893 14.3641 16.3893C14.5515 16.3893 14.7311 16.3149 14.8636 16.1824C14.9961 16.0499 15.0705 15.8702 15.0705 15.6829V12.0408Z" fill="white"/>
|
||||
<path d="M14.067 4.44512C13.9963 4.38501 13.9145 4.33941 13.8262 4.31092C13.7379 4.28243 13.6448 4.27162 13.5524 4.27909C13.4599 4.28656 13.3698 4.31218 13.2872 4.35448C13.2047 4.39677 13.1312 4.45492 13.0711 4.5256L9.12344 9.16752C9.02533 9.28249 8.96687 9.426 8.95672 9.5768C8.95112 9.61248 8.94824 9.6488 8.94824 9.68608V15.6202C8.94824 15.8075 9.02267 15.9872 9.15514 16.1197C9.28762 16.2521 9.46729 16.3266 9.65464 16.3266C9.84199 16.3266 10.0217 16.2521 10.1541 16.1197C10.2866 15.9872 10.361 15.8075 10.361 15.6202V9.8928L14.1474 5.44096C14.2076 5.37029 14.2532 5.28847 14.2816 5.20018C14.3101 5.11189 14.3209 5.01885 14.3135 4.92637C14.306 4.8339 14.2804 4.7438 14.2381 4.66123C14.1958 4.57865 14.1376 4.50522 14.067 4.44512Z" fill="white"/>
|
||||
<path d="M5.33941 4.12558C5.2806 4.05384 5.20823 3.99438 5.12644 3.9506C5.04465 3.90683 4.95504 3.87959 4.86272 3.87045C4.77041 3.8613 4.67719 3.87043 4.58841 3.89731C4.49962 3.92419 4.41699 3.96829 4.34525 4.0271C4.2735 4.08591 4.21405 4.15828 4.17027 4.24007C4.12649 4.32186 4.09926 4.41147 4.09011 4.50379C4.08097 4.5961 4.09009 4.68932 4.11697 4.7781C4.14385 4.86689 4.18796 4.94952 4.24677 5.02126L7.04389 8.43326C7.16266 8.57818 7.33414 8.66997 7.5206 8.68846C7.70705 8.70694 7.89321 8.6506 8.03813 8.53182C8.18304 8.41305 8.27484 8.24157 8.29332 8.05511C8.31181 7.86866 8.25546 7.6825 8.13669 7.53758L5.33925 4.12558H5.33941Z" fill="white"/>
|
||||
<path d="M15.3376 10.1726C15.5666 10.1726 15.7862 10.0817 15.9481 9.91972C16.11 9.7578 16.201 9.53818 16.201 9.30918C16.201 9.08018 16.11 8.86056 15.9481 8.69864C15.7862 8.53671 15.5666 8.44574 15.3376 8.44574C15.1086 8.44574 14.8889 8.53671 14.727 8.69864C14.5651 8.86056 14.4741 9.08018 14.4741 9.30918C14.4741 9.53818 14.5651 9.7578 14.727 9.91972C14.8889 10.0817 15.1086 10.1726 15.3376 10.1726Z" fill="#00FF25"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_12804_895">
|
||||
<clipPath id="clip0_19_444">
|
||||
<rect width="20" height="20" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
@@ -6,12 +6,14 @@
|
||||
"details": "Details",
|
||||
"duration_seconds": "Duration (seconds)",
|
||||
"generation_time": "Generation time",
|
||||
"input_token_length": "input tokens",
|
||||
"member": "member",
|
||||
"member_name": "Member name",
|
||||
"module_name": "module name",
|
||||
"month": "moon",
|
||||
"no_usage_records": "No usage record yet",
|
||||
"order_number": "Order number",
|
||||
"output_token_length": "output tokens",
|
||||
"project_name": "Project name",
|
||||
"source": "source",
|
||||
"text_length": "text length",
|
||||
@@ -20,4 +22,4 @@
|
||||
"total_points_consumed": "AI points consumption",
|
||||
"usage_detail": "Usage details",
|
||||
"user_type": "type"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,6 +447,8 @@
|
||||
"core.chat.response.Extension model": "Question Optimization Model",
|
||||
"core.chat.response.Read complete response": "View Details",
|
||||
"core.chat.response.Read complete response tips": "Click to View Detailed Process",
|
||||
"core.chat.response.Tool call input tokens": "Tool Call Input Tokens Consumption",
|
||||
"core.chat.response.Tool call output tokens": "Tool Call Output Tokens Consumption",
|
||||
"core.chat.response.Tool call tokens": "Tool Call Tokens Consumption",
|
||||
"core.chat.response.context total length": "Total Context Length",
|
||||
"core.chat.response.loop_input": "Loop Input Array",
|
||||
@@ -460,10 +462,12 @@
|
||||
"core.chat.response.module historyPreview": "History Preview (Only Partial Content Displayed)",
|
||||
"core.chat.response.module http result": "Response Body",
|
||||
"core.chat.response.module if else Result": "Condition Result",
|
||||
"core.chat.response.module input tokens": "input tokens",
|
||||
"core.chat.response.module limit": "Single Search Limit",
|
||||
"core.chat.response.module maxToken": "Max Response Tokens",
|
||||
"core.chat.response.module model": "Model",
|
||||
"core.chat.response.module name": "Model Name",
|
||||
"core.chat.response.module output tokens": "output tokens",
|
||||
"core.chat.response.module query": "Question/Search Term",
|
||||
"core.chat.response.module quoteList": "Quote Content",
|
||||
"core.chat.response.module similarity": "Similarity",
|
||||
@@ -911,6 +915,8 @@
|
||||
"model.type.embedding": "Embedding",
|
||||
"model.type.stt": "speech recognition",
|
||||
"model.type.tts": "TTS",
|
||||
"model_alicloud": "Ali Cloud",
|
||||
"model_baai": "BAAI",
|
||||
"model_baichuan": "Baichuan",
|
||||
"model_chatglm": "ChatGLM",
|
||||
"model_doubao": "Doubao",
|
||||
@@ -920,6 +926,7 @@
|
||||
"model_other": "Other",
|
||||
"model_qwen": "Qwen",
|
||||
"model_sparkdesk": "SprkDesk",
|
||||
"model_stepfun": "StepFun",
|
||||
"model_yi": "Yi",
|
||||
"move.confirm": "Confirm move",
|
||||
"navbar.Account": "Account",
|
||||
@@ -1043,6 +1050,8 @@
|
||||
"support.user.team.Team Tags Async Success": "Sync Completed",
|
||||
"support.user.team.member": "Member",
|
||||
"support.wallet.Ai point every thousand tokens": "{{points}} Points/1K Tokens",
|
||||
"support.wallet.Ai point every thousand tokens_input": "Input:{{points}} points/1K tokens",
|
||||
"support.wallet.Ai point every thousand tokens_output": "Output:{{points}} points/1K tokens",
|
||||
"support.wallet.Amount": "Amount",
|
||||
"support.wallet.Buy": "Buy",
|
||||
"support.wallet.Not sufficient": "Insufficient AI Points, Please Upgrade Your Package or Purchase Additional AI Points to Continue Using.",
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
{
|
||||
"usage_detail": "使用详情",
|
||||
"order_number": "订单号",
|
||||
"generation_time": "生成时间",
|
||||
"month": "月",
|
||||
"app_name": "应用名",
|
||||
"source": "来源",
|
||||
"total_points_consumed": "AI 积分消耗",
|
||||
"billing_module": "扣费模块",
|
||||
"module_name": "模块名",
|
||||
"ai_model": "AI 模型",
|
||||
"token_length": "token 长度",
|
||||
"text_length": "文本长度",
|
||||
"duration_seconds": "时长(秒)",
|
||||
"all": "所有",
|
||||
"app_name": "应用名",
|
||||
"billing_module": "扣费模块",
|
||||
"details": "详情",
|
||||
"duration_seconds": "时长(秒)",
|
||||
"generation_time": "生成时间",
|
||||
"input_token_length": "输入 tokens",
|
||||
"member": "成员",
|
||||
"member_name": "成员名",
|
||||
"user_type": "类型",
|
||||
"module_name": "模块名",
|
||||
"month": "月",
|
||||
"no_usage_records": "暂无使用记录",
|
||||
"order_number": "订单号",
|
||||
"output_token_length": "输出 tokens",
|
||||
"project_name": "项目名",
|
||||
"source": "来源",
|
||||
"text_length": "文本长度",
|
||||
"token_length": "token 长度",
|
||||
"total_points": "AI 积分消耗",
|
||||
"details": "详情",
|
||||
"no_usage_records": "暂无使用记录"
|
||||
}
|
||||
"total_points_consumed": "AI 积分消耗",
|
||||
"usage_detail": "使用详情",
|
||||
"user_type": "类型"
|
||||
}
|
||||
|
||||
@@ -450,6 +450,8 @@
|
||||
"core.chat.response.Extension model": "问题优化模型",
|
||||
"core.chat.response.Read complete response": "查看详情",
|
||||
"core.chat.response.Read complete response tips": "点击查看详细流程",
|
||||
"core.chat.response.Tool call input tokens": "工具调用输入 Tokens",
|
||||
"core.chat.response.Tool call output tokens": "工具调用输出 Tokens",
|
||||
"core.chat.response.Tool call tokens": "工具调用 tokens 消耗",
|
||||
"core.chat.response.context total length": "上下文总长度",
|
||||
"core.chat.response.loop_input": "输入数组",
|
||||
@@ -463,10 +465,12 @@
|
||||
"core.chat.response.module historyPreview": "记录预览(仅展示部分内容)",
|
||||
"core.chat.response.module http result": "响应体",
|
||||
"core.chat.response.module if else Result": "判断器结果",
|
||||
"core.chat.response.module input tokens": "输入 Tokens",
|
||||
"core.chat.response.module limit": "单次搜索上限",
|
||||
"core.chat.response.module maxToken": "最大响应 tokens",
|
||||
"core.chat.response.module model": "模型",
|
||||
"core.chat.response.module name": "模型名",
|
||||
"core.chat.response.module output tokens": "输出 Tokens",
|
||||
"core.chat.response.module query": "问题/检索词",
|
||||
"core.chat.response.module quoteList": "引用内容",
|
||||
"core.chat.response.module similarity": "相似度",
|
||||
@@ -914,6 +918,8 @@
|
||||
"model.type.embedding": "索引模型",
|
||||
"model.type.stt": "语音识别",
|
||||
"model.type.tts": "语音合成",
|
||||
"model_alicloud": "阿里云",
|
||||
"model_baai": "智源",
|
||||
"model_baichuan": "百川智能",
|
||||
"model_chatglm": "ChatGLM",
|
||||
"model_doubao": "豆包",
|
||||
@@ -923,6 +929,7 @@
|
||||
"model_other": "其他",
|
||||
"model_qwen": "阿里千问",
|
||||
"model_sparkdesk": "讯飞星火",
|
||||
"model_stepfun": "阶跃星辰",
|
||||
"model_yi": "零一万物",
|
||||
"move.confirm": "确认移动",
|
||||
"navbar.Account": "账号",
|
||||
@@ -1046,6 +1053,8 @@
|
||||
"support.user.team.Team Tags Async Success": "同步完成",
|
||||
"support.user.team.member": "成员",
|
||||
"support.wallet.Ai point every thousand tokens": "{{points}} 积分/1K tokens",
|
||||
"support.wallet.Ai point every thousand tokens_input": "输入:{{points}} 积分/1K tokens",
|
||||
"support.wallet.Ai point every thousand tokens_output": "输出:{{points}} 积分/1K tokens",
|
||||
"support.wallet.Amount": "金额",
|
||||
"support.wallet.Buy": "购买",
|
||||
"support.wallet.Not sufficient": "您的 AI 积分不足,请先升级套餐或购买额外 AI 积分后继续使用。",
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
"details": "詳情",
|
||||
"duration_seconds": "時長(秒)",
|
||||
"generation_time": "生成時間",
|
||||
"input_token_length": "輸入 tokens",
|
||||
"member": "成員",
|
||||
"member_name": "成員名",
|
||||
"module_name": "模組名",
|
||||
"month": "月",
|
||||
"no_usage_records": "暫無使用紀錄",
|
||||
"order_number": "訂單編號",
|
||||
"output_token_length": "輸出 tokens",
|
||||
"project_name": "專案名",
|
||||
"source": "來源",
|
||||
"text_length": "文字長度",
|
||||
@@ -20,4 +22,4 @@
|
||||
"total_points_consumed": "AI 積分消耗",
|
||||
"usage_detail": "使用詳情",
|
||||
"user_type": "類型"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,6 +447,8 @@
|
||||
"core.chat.response.Extension model": "問題最佳化模型",
|
||||
"core.chat.response.Read complete response": "檢視詳細資料",
|
||||
"core.chat.response.Read complete response tips": "點選檢視詳細流程",
|
||||
"core.chat.response.Tool call input tokens": "工具呼叫輸入 Token 消耗",
|
||||
"core.chat.response.Tool call output tokens": "工具呼叫輸出 Token 消耗",
|
||||
"core.chat.response.Tool call tokens": "工具呼叫 Token 消耗",
|
||||
"core.chat.response.context total length": "上下文總長度",
|
||||
"core.chat.response.loop_input": "輸入陣列",
|
||||
@@ -460,10 +462,12 @@
|
||||
"core.chat.response.module historyPreview": "記錄預覽(僅顯示部分內容)",
|
||||
"core.chat.response.module http result": "回應內容",
|
||||
"core.chat.response.module if else Result": "條件判斷結果",
|
||||
"core.chat.response.module input tokens": "輸入 tokens",
|
||||
"core.chat.response.module limit": "單次搜尋上限",
|
||||
"core.chat.response.module maxToken": "最大回應 Token 數",
|
||||
"core.chat.response.module model": "模型",
|
||||
"core.chat.response.module name": "模型名稱",
|
||||
"core.chat.response.module output tokens": "輸出 tokens",
|
||||
"core.chat.response.module query": "問題/搜尋詞",
|
||||
"core.chat.response.module quoteList": "引用內容",
|
||||
"core.chat.response.module similarity": "相似度",
|
||||
@@ -911,6 +915,8 @@
|
||||
"model.type.chat": "語言模型",
|
||||
"model.type.stt": "語音辨識",
|
||||
"model.type.tts": "語音合成",
|
||||
"model_alicloud": "阿里雲",
|
||||
"model_baai": "智源",
|
||||
"model_baichuan": "百川智能",
|
||||
"model_chatglm": "ChatGLM",
|
||||
"model_doubao": "豆包",
|
||||
@@ -920,6 +926,7 @@
|
||||
"model_other": "其他",
|
||||
"model_qwen": "阿里千問",
|
||||
"model_sparkdesk": "訊飛星火",
|
||||
"model_stepfun": "階躍星辰",
|
||||
"model_yi": "零一萬物",
|
||||
"move.confirm": "確認移動",
|
||||
"navbar.Account": "帳戶",
|
||||
@@ -1043,6 +1050,8 @@
|
||||
"support.user.team.Team Tags Async Success": "同步完成",
|
||||
"support.user.team.member": "成員",
|
||||
"support.wallet.Ai point every thousand tokens": "{{points}} 點數/1K tokens",
|
||||
"support.wallet.Ai point every thousand tokens_input": "輸入:{{points}} 积分/1K tokens",
|
||||
"support.wallet.Ai point every thousand tokens_output": "輸出:{{points}} 积分/1K tokens",
|
||||
"support.wallet.Amount": "金額",
|
||||
"support.wallet.Buy": "購買",
|
||||
"support.wallet.Not sufficient": "您的 AI 點數不足,請先升級方案或購買額外 AI 點數後繼續使用。",
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
"reRankModels": [],
|
||||
"audioSpeechModels": [
|
||||
{
|
||||
"provider": "OpenAI",
|
||||
"model": "tts-1",
|
||||
"name": "OpenAI TTS1",
|
||||
"charsPointsPrice": 0,
|
||||
@@ -165,6 +166,7 @@
|
||||
}
|
||||
],
|
||||
"whisperModel": {
|
||||
"provider": "OpenAI",
|
||||
"model": "whisper-1",
|
||||
"name": "Whisper1",
|
||||
"charsPointsPrice": 0
|
||||
|
||||
@@ -18,7 +18,6 @@ import {
|
||||
Thead,
|
||||
Tr,
|
||||
Table,
|
||||
useDisclosure,
|
||||
FlexProps
|
||||
} from '@chakra-ui/react';
|
||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||
@@ -175,10 +174,28 @@ const AIChatSettingsModal = ({
|
||||
<Tbody>
|
||||
<Tr color={'myGray.900'}>
|
||||
<Td pt={0} pb={2}>
|
||||
{t('common:support.wallet.Ai point every thousand tokens', {
|
||||
points: selectedModel?.charsPointsPrice || 0
|
||||
})}
|
||||
{typeof selectedModel?.inputPrice === 'number' ? (
|
||||
<>
|
||||
<Box>
|
||||
{t('common:support.wallet.Ai point every thousand tokens_input', {
|
||||
points: selectedModel?.inputPrice || 0
|
||||
})}
|
||||
</Box>
|
||||
<Box>
|
||||
{t('common:support.wallet.Ai point every thousand tokens_output', {
|
||||
points: selectedModel?.outputPrice || 0
|
||||
})}
|
||||
</Box>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
{t('common:support.wallet.Ai point every thousand tokens', {
|
||||
points: selectedModel?.charsPointsPrice || 0
|
||||
})}
|
||||
</>
|
||||
)}
|
||||
</Td>
|
||||
|
||||
<Td pt={0} pb={2}>
|
||||
{Math.round((selectedModel?.maxContext || 4096) / 1000)}K
|
||||
</Td>
|
||||
|
||||
@@ -60,14 +60,32 @@ const ModelTable = () => {
|
||||
const formatLLMModelList = llmModelList.map((item) => ({
|
||||
...item,
|
||||
typeLabel: t('common:model.type.chat'),
|
||||
priceLabel: (
|
||||
<Flex color={'myGray.700'}>
|
||||
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
|
||||
{item.charsPointsPrice}
|
||||
priceLabel:
|
||||
typeof item.inputPrice === 'number' ? (
|
||||
<Box>
|
||||
<Flex>
|
||||
{`${t('common:common.Input')}:`}
|
||||
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5} ml={2}>
|
||||
{item.inputPrice || 0}
|
||||
</Box>
|
||||
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
|
||||
</Flex>
|
||||
<Flex>
|
||||
{`${t('common:common.Output')}:`}
|
||||
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5} ml={2}>
|
||||
{item.outputPrice || 0}
|
||||
</Box>
|
||||
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
|
||||
</Flex>
|
||||
</Box>
|
||||
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
|
||||
</Flex>
|
||||
),
|
||||
) : (
|
||||
<Flex color={'myGray.700'}>
|
||||
<Box fontWeight={'bold'} color={'myGray.900'} mr={0.5}>
|
||||
{item.charsPointsPrice}
|
||||
</Box>
|
||||
{`${t('common:support.wallet.subscription.point')} / 1K Tokens`}
|
||||
</Flex>
|
||||
),
|
||||
tagColor: 'blue'
|
||||
}));
|
||||
const formatVectorModelList = vectorModelList.map((item) => ({
|
||||
@@ -149,13 +167,13 @@ const ModelTable = () => {
|
||||
|
||||
return filterList;
|
||||
}, [
|
||||
provider,
|
||||
modelType,
|
||||
llmModelList,
|
||||
vectorModelList,
|
||||
audioSpeechModelList,
|
||||
whisperModel,
|
||||
t,
|
||||
modelType,
|
||||
provider,
|
||||
search
|
||||
]);
|
||||
|
||||
|
||||
@@ -155,10 +155,26 @@ export const WholeResponseContent = ({
|
||||
label={t('common:core.chat.response.module tokens')}
|
||||
value={`${activeModule?.tokens}`}
|
||||
/>
|
||||
<Row
|
||||
label={t('common:core.chat.response.module input tokens')}
|
||||
value={`${activeModule?.inputTokens}`}
|
||||
/>
|
||||
<Row
|
||||
label={t('common:core.chat.response.module output tokens')}
|
||||
value={`${activeModule?.outputTokens}`}
|
||||
/>
|
||||
<Row
|
||||
label={t('common:core.chat.response.Tool call tokens')}
|
||||
value={`${activeModule?.toolCallTokens}`}
|
||||
/>
|
||||
<Row
|
||||
label={t('common:core.chat.response.Tool call input tokens')}
|
||||
value={`${activeModule?.toolCallInputTokens}`}
|
||||
/>
|
||||
<Row
|
||||
label={t('common:core.chat.response.Tool call output tokens')}
|
||||
value={`${activeModule?.toolCallOutputTokens}`}
|
||||
/>
|
||||
|
||||
<Row label={t('common:core.chat.response.module query')} value={activeModule?.query} />
|
||||
<Row
|
||||
|
||||
@@ -26,37 +26,48 @@ const UsageDetail = ({ usage, onClose }: { usage: UsageItemType; onClose: () =>
|
||||
[usage.list]
|
||||
);
|
||||
|
||||
const { hasModel, hasToken, hasCharsLen, hasDuration } = useMemo(() => {
|
||||
let hasModel = false;
|
||||
let hasToken = false;
|
||||
let hasCharsLen = false;
|
||||
let hasDuration = false;
|
||||
let hasDataLen = false;
|
||||
const { hasModel, hasToken, hasInputToken, hasOutputToken, hasCharsLen, hasDuration } =
|
||||
useMemo(() => {
|
||||
let hasModel = false;
|
||||
let hasToken = false;
|
||||
let hasInputToken = false;
|
||||
let hasOutputToken = false;
|
||||
let hasCharsLen = false;
|
||||
let hasDuration = false;
|
||||
let hasDataLen = false;
|
||||
|
||||
usage.list.forEach((item) => {
|
||||
if (item.model !== undefined) {
|
||||
hasModel = true;
|
||||
}
|
||||
usage.list.forEach((item) => {
|
||||
if (item.model !== undefined) {
|
||||
hasModel = true;
|
||||
}
|
||||
|
||||
if (typeof item.tokens === 'number') {
|
||||
hasToken = true;
|
||||
}
|
||||
if (typeof item.charsLength === 'number') {
|
||||
hasCharsLen = true;
|
||||
}
|
||||
if (typeof item.duration === 'number') {
|
||||
hasDuration = true;
|
||||
}
|
||||
});
|
||||
if (typeof item.tokens === 'number') {
|
||||
hasToken = true;
|
||||
}
|
||||
if (typeof item.inputTokens === 'number') {
|
||||
hasInputToken = true;
|
||||
}
|
||||
if (typeof item.outputTokens === 'number') {
|
||||
hasOutputToken = true;
|
||||
}
|
||||
if (typeof item.charsLength === 'number') {
|
||||
hasCharsLen = true;
|
||||
}
|
||||
if (typeof item.duration === 'number') {
|
||||
hasDuration = true;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
hasModel,
|
||||
hasToken,
|
||||
hasCharsLen,
|
||||
hasDuration,
|
||||
hasDataLen
|
||||
};
|
||||
}, [usage.list]);
|
||||
return {
|
||||
hasModel,
|
||||
hasToken,
|
||||
hasInputToken,
|
||||
hasOutputToken,
|
||||
hasCharsLen,
|
||||
hasDuration,
|
||||
hasDataLen
|
||||
};
|
||||
}, [usage.list]);
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
@@ -98,6 +109,8 @@ const UsageDetail = ({ usage, onClose }: { usage: UsageItemType; onClose: () =>
|
||||
<Th>{t('account_usage:module_name')}</Th>
|
||||
{hasModel && <Th>{t('account_usage:ai_model')}</Th>}
|
||||
{hasToken && <Th>{t('account_usage:token_length')}</Th>}
|
||||
{hasInputToken && <Th>{t('account_usage:input_token_length')}</Th>}
|
||||
{hasOutputToken && <Th>{t('account_usage:output_token_length')}</Th>}
|
||||
{hasCharsLen && <Th>{t('account_usage:text_length')}</Th>}
|
||||
{hasDuration && <Th>{t('account_usage:duration_seconds')}</Th>}
|
||||
<Th>{t('account_usage:total_points_consumed')}</Th>
|
||||
@@ -109,6 +122,8 @@ const UsageDetail = ({ usage, onClose }: { usage: UsageItemType; onClose: () =>
|
||||
<Td>{t(item.moduleName as any)}</Td>
|
||||
{hasModel && <Td>{item.model ?? '-'}</Td>}
|
||||
{hasToken && <Td>{item.tokens ?? '-'}</Td>}
|
||||
{hasInputToken && <Td>{item.inputTokens ?? '-'}</Td>}
|
||||
{hasOutputToken && <Td>{item.outputTokens ?? '-'}</Td>}
|
||||
{hasCharsLen && <Td>{item.charsLength ?? '-'}</Td>}
|
||||
{hasDuration && <Td>{item.duration ?? '-'}</Td>}
|
||||
<Td>{formatNumber(item.amount)}</Td>
|
||||
|
||||
@@ -37,7 +37,7 @@ async function handler(
|
||||
|
||||
const qgModel = global.llmModels[0];
|
||||
|
||||
const { result, tokens } = await createQuestionGuide({
|
||||
const { result, inputTokens, outputTokens } = await createQuestionGuide({
|
||||
messages,
|
||||
model: qgModel.model
|
||||
});
|
||||
@@ -47,7 +47,8 @@ async function handler(
|
||||
});
|
||||
|
||||
pushQuestionGuideUsage({
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
teamId,
|
||||
tmbId
|
||||
});
|
||||
|
||||
@@ -52,14 +52,15 @@ async function handler(req: ApiRequestProps<CreateQuestionGuideParams>, res: Nex
|
||||
|
||||
const qgModel = questionGuide?.model || global.llmModels[0].model;
|
||||
|
||||
const { result, tokens } = await createQuestionGuide({
|
||||
const { result, inputTokens, outputTokens } = await createQuestionGuide({
|
||||
messages,
|
||||
model: qgModel,
|
||||
customPrompt: questionGuide?.customPrompt
|
||||
});
|
||||
|
||||
pushQuestionGuideUsage({
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
teamId,
|
||||
tmbId
|
||||
});
|
||||
|
||||
@@ -89,7 +89,7 @@ async function handler(req: NextApiRequest) {
|
||||
pushGenerateVectorUsage({
|
||||
teamId,
|
||||
tmbId,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
model: vectorModelData.model
|
||||
});
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ async function handler(req: ApiRequestProps<UpdateDatasetDataProps>) {
|
||||
pushGenerateVectorUsage({
|
||||
teamId,
|
||||
tmbId,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
model: vectorModel
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -74,14 +74,15 @@ async function handler(req: NextApiRequest) {
|
||||
const { totalPoints } = pushGenerateVectorUsage({
|
||||
teamId,
|
||||
tmbId,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
model: dataset.vectorModel,
|
||||
source: apikey ? UsageSourceEnum.api : UsageSourceEnum.fastgpt,
|
||||
|
||||
...(aiExtensionResult &&
|
||||
extensionModel && {
|
||||
extensionModel: extensionModel.name,
|
||||
extensionTokens: aiExtensionResult.tokens
|
||||
extensionInputTokens: aiExtensionResult.inputTokens,
|
||||
extensionOutputTokens: aiExtensionResult.outputTokens
|
||||
})
|
||||
});
|
||||
if (apikey) {
|
||||
|
||||
@@ -57,7 +57,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
const { totalPoints } = pushGenerateVectorUsage({
|
||||
teamId,
|
||||
tmbId,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
model,
|
||||
billId,
|
||||
source: getUsageSourceByAuthType({ authType })
|
||||
|
||||
@@ -196,7 +196,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
chunkSize: vectorModel?.defaultToken ? vectorModel?.defaultToken * 2 : 1024,
|
||||
showChunkInput: false,
|
||||
showPromptInput: false,
|
||||
charsPointsPrice: agentModel.charsPointsPrice,
|
||||
charsPointsPrice: agentModel.charsPointsPrice || 0,
|
||||
priceTip: t('dataset:import.Auto mode Estimated Price Tips', {
|
||||
price: agentModel.charsPointsPrice
|
||||
}),
|
||||
@@ -211,7 +211,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
chunkSize: embeddingChunkSize,
|
||||
showChunkInput: true,
|
||||
showPromptInput: false,
|
||||
charsPointsPrice: vectorModel.charsPointsPrice,
|
||||
charsPointsPrice: vectorModel.charsPointsPrice || 0,
|
||||
priceTip: t('dataset:import.Embedding Estimated Price Tips', {
|
||||
price: vectorModel.charsPointsPrice
|
||||
}),
|
||||
@@ -226,7 +226,7 @@ const DatasetImportContextProvider = ({ children }: { children: React.ReactNode
|
||||
chunkSize: qaChunkSize,
|
||||
showChunkInput: true,
|
||||
showPromptInput: true,
|
||||
charsPointsPrice: agentModel.charsPointsPrice,
|
||||
charsPointsPrice: agentModel.charsPointsPrice || 0,
|
||||
priceTip: t('dataset:import.Auto mode Estimated Price Tips', {
|
||||
price: agentModel.charsPointsPrice
|
||||
}),
|
||||
|
||||
@@ -12,7 +12,10 @@ import { getLLMModel } from '@fastgpt/service/core/ai/model';
|
||||
import { checkTeamAiPointsAndLock } from './utils';
|
||||
import { checkInvalidChunkAndLock } from '@fastgpt/service/core/dataset/training/utils';
|
||||
import { addMinutes } from 'date-fns';
|
||||
import { countGptMessagesTokens } from '@fastgpt/service/common/string/tiktoken/index';
|
||||
import {
|
||||
countGptMessagesTokens,
|
||||
countPromptTokens
|
||||
} from '@fastgpt/service/common/string/tiktoken/index';
|
||||
import { pushDataListToTrainingQueueByCollectionId } from '@fastgpt/service/core/dataset/training/controller';
|
||||
import { loadRequestMessages } from '@fastgpt/service/core/chat/utils';
|
||||
import { llmCompletionsBodyFormat } from '@fastgpt/service/core/ai/utils';
|
||||
@@ -153,7 +156,8 @@ ${replaceVariable(Prompt_AgentQA.fixedText, { text })}`;
|
||||
pushQAUsage({
|
||||
teamId: data.teamId,
|
||||
tmbId: data.tmbId,
|
||||
tokens: await countGptMessagesTokens(messages),
|
||||
inputTokens: await countGptMessagesTokens(messages),
|
||||
outputTokens: await countPromptTokens(answer),
|
||||
billId: data.billId,
|
||||
model: modelData.model
|
||||
});
|
||||
|
||||
@@ -111,7 +111,7 @@ export async function generateVector(): Promise<any> {
|
||||
pushGenerateVectorUsage({
|
||||
teamId: data.teamId,
|
||||
tmbId: data.tmbId,
|
||||
tokens,
|
||||
inputTokens: tokens,
|
||||
model: data.model,
|
||||
billId: data.billId
|
||||
});
|
||||
|
||||
@@ -37,7 +37,8 @@ export const pushChatUsage = ({
|
||||
moduleName: item.moduleName,
|
||||
amount: item.totalPoints || 0,
|
||||
model: item.model,
|
||||
tokens: item.tokens
|
||||
inputTokens: item.inputTokens,
|
||||
outputTokens: item.outputTokens
|
||||
}))
|
||||
});
|
||||
addLog.info(`finish completions`, {
|
||||
@@ -52,20 +53,23 @@ export const pushQAUsage = async ({
|
||||
teamId,
|
||||
tmbId,
|
||||
model,
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
billId
|
||||
}: {
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
model: string;
|
||||
tokens: number;
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
billId: string;
|
||||
}) => {
|
||||
// 计算价格
|
||||
const { totalPoints } = formatModelChars2Points({
|
||||
model,
|
||||
modelType: ModelTypeEnum.llm,
|
||||
tokens
|
||||
inputTokens,
|
||||
outputTokens
|
||||
});
|
||||
|
||||
concatUsage({
|
||||
@@ -73,7 +77,8 @@ export const pushQAUsage = async ({
|
||||
teamId,
|
||||
tmbId,
|
||||
totalPoints,
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
listIndex: 1
|
||||
});
|
||||
|
||||
@@ -84,30 +89,32 @@ export const pushGenerateVectorUsage = ({
|
||||
billId,
|
||||
teamId,
|
||||
tmbId,
|
||||
tokens,
|
||||
inputTokens,
|
||||
model,
|
||||
source = UsageSourceEnum.fastgpt,
|
||||
extensionModel,
|
||||
extensionTokens
|
||||
extensionInputTokens,
|
||||
extensionOutputTokens
|
||||
}: {
|
||||
billId?: string;
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
tokens: number;
|
||||
inputTokens: number;
|
||||
model: string;
|
||||
source?: UsageSourceEnum;
|
||||
|
||||
extensionModel?: string;
|
||||
extensionTokens?: number;
|
||||
extensionInputTokens?: number;
|
||||
extensionOutputTokens?: number;
|
||||
}) => {
|
||||
const { totalPoints: totalVector, modelName: vectorModelName } = formatModelChars2Points({
|
||||
modelType: ModelTypeEnum.vector,
|
||||
model,
|
||||
tokens
|
||||
inputTokens
|
||||
});
|
||||
|
||||
const { extensionTotalPoints, extensionModelName } = (() => {
|
||||
if (!extensionModel || !extensionTokens)
|
||||
if (!extensionModel || !extensionInputTokens)
|
||||
return {
|
||||
extensionTotalPoints: 0,
|
||||
extensionModelName: ''
|
||||
@@ -115,7 +122,8 @@ export const pushGenerateVectorUsage = ({
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
modelType: ModelTypeEnum.llm,
|
||||
model: extensionModel,
|
||||
tokens: extensionTokens
|
||||
inputTokens: extensionInputTokens,
|
||||
outputTokens: extensionOutputTokens
|
||||
});
|
||||
return {
|
||||
extensionTotalPoints: totalPoints,
|
||||
@@ -132,7 +140,7 @@ export const pushGenerateVectorUsage = ({
|
||||
tmbId,
|
||||
totalPoints,
|
||||
billId,
|
||||
tokens,
|
||||
inputTokens,
|
||||
listIndex: 0
|
||||
});
|
||||
} else {
|
||||
@@ -147,7 +155,7 @@ export const pushGenerateVectorUsage = ({
|
||||
moduleName: 'support.wallet.moduleName.index',
|
||||
amount: totalVector,
|
||||
model: vectorModelName,
|
||||
tokens
|
||||
inputTokens
|
||||
},
|
||||
...(extensionModel !== undefined
|
||||
? [
|
||||
@@ -155,7 +163,8 @@ export const pushGenerateVectorUsage = ({
|
||||
moduleName: 'core.module.template.Query extension',
|
||||
amount: extensionTotalPoints,
|
||||
model: extensionModelName,
|
||||
tokens: extensionTokens
|
||||
inputTokens: extensionInputTokens,
|
||||
outputTokens: extensionOutputTokens
|
||||
}
|
||||
]
|
||||
: [])
|
||||
@@ -166,17 +175,20 @@ export const pushGenerateVectorUsage = ({
|
||||
};
|
||||
|
||||
export const pushQuestionGuideUsage = ({
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
teamId,
|
||||
tmbId
|
||||
}: {
|
||||
tokens: number;
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
teamId: string;
|
||||
tmbId: string;
|
||||
}) => {
|
||||
const qgModel = global.llmModels[0];
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
tokens,
|
||||
inputTokens,
|
||||
outputTokens,
|
||||
model: qgModel.model,
|
||||
modelType: ModelTypeEnum.llm
|
||||
});
|
||||
@@ -192,7 +204,8 @@ export const pushQuestionGuideUsage = ({
|
||||
moduleName: 'core.app.Question Guide',
|
||||
amount: totalPoints,
|
||||
model: modelName,
|
||||
tokens
|
||||
inputTokens,
|
||||
outputTokens
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -215,7 +228,7 @@ export function pushAudioSpeechUsage({
|
||||
}) {
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model,
|
||||
tokens: charsLength,
|
||||
inputTokens: charsLength,
|
||||
modelType: ModelTypeEnum.audioSpeech
|
||||
});
|
||||
|
||||
@@ -251,7 +264,7 @@ export function pushWhisperUsage({
|
||||
|
||||
const { totalPoints, modelName } = formatModelChars2Points({
|
||||
model: whisperModel.model,
|
||||
tokens: duration,
|
||||
inputTokens: duration,
|
||||
modelType: ModelTypeEnum.whisper,
|
||||
multiple: 60
|
||||
});
|
||||
|
||||
@@ -14,7 +14,7 @@ export const clientInitData = async (
|
||||
useSystemStore.getState().initStaticData(res);
|
||||
|
||||
return {
|
||||
feConfigs: res.feConfigs || {}
|
||||
feConfigs: res.feConfigs || useSystemStore.getState().feConfigs || {}
|
||||
};
|
||||
} catch (error) {
|
||||
if (retry > 0) {
|
||||
|
||||