fix: price page init data;perf: usage code;fix: reasoning tokens;fix: workflow basic node cannot upgrade (#3816)

* fix: img read

* fix: price page init data

* perf: ai model avatar

* perf: refresh in change team

* perf: null checker

* perf: usage code

* fix: reasoning tokens

* fix: workflow basic node cannot upgrade

* perf: model refresh

* perf: icon refresh
This commit is contained in:
Archer
2025-02-18 20:50:25 +08:00
committed by GitHub
parent ccf28d83b8
commit 09205e4666
32 changed files with 373 additions and 248 deletions

View File

@@ -44,12 +44,22 @@ async function handler(
defaultModels: global.systemDefaultModel
};
} catch (error) {
const referer = req.headers.referer;
if (referer?.includes('/price')) {
return {
feConfigs: global.feConfigs,
subPlans: global.subPlans,
activeModelList
};
}
const unAuthBufferId = global.systemInitBufferId ? `unAuth_${global.systemInitBufferId}` : '';
if (bufferId && unAuthBufferId === bufferId) {
return {
bufferId: unAuthBufferId
};
}
return {
bufferId: unAuthBufferId,
feConfigs: global.feConfigs

View File

@@ -5,7 +5,7 @@ import {
SseResponseEventEnum
} from '@fastgpt/global/core/workflow/runtime/constants';
import { responseWrite } from '@fastgpt/service/common/response';
import { pushChatUsage } from '@/service/support/wallet/usage/push';
import { createChatUsage } from '@fastgpt/service/support/wallet/usage/controller';
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
import type { AIChatItemType, UserChatItemType } from '@fastgpt/global/core/chat/type';
import { authApp } from '@fastgpt/service/support/permission/app/auth';
@@ -244,7 +244,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}
}
pushChatUsage({
createChatUsage({
appName,
appId,
teamId,

View File

@@ -1,5 +1,5 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { pushChatUsage } from '@/service/support/wallet/usage/push';
import { createChatUsage } from '@fastgpt/service/support/wallet/usage/controller';
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
import { authApp } from '@fastgpt/service/support/permission/app/auth';
import { dispatchWorkFlow } from '@fastgpt/service/core/workflow/dispatch';
@@ -66,8 +66,8 @@ async function handler(
maxRunTimes: WORKFLOW_MAX_RUN_TIMES
});
pushChatUsage({
appName: '工作流Debug',
createChatUsage({
appName: `${app.name}-Debug`,
appId,
teamId,
tmbId,

View File

@@ -20,7 +20,7 @@ import { GPTMessages2Chats, chatValue2RuntimePrompt } from '@fastgpt/global/core
import { getChatItems } from '@fastgpt/service/core/chat/controller';
import { saveChat, updateInteractiveChat } from '@fastgpt/service/core/chat/saveChat';
import { responseWrite } from '@fastgpt/service/common/response';
import { pushChatUsage } from '@/service/support/wallet/usage/push';
import { createChatUsage } from '@fastgpt/service/support/wallet/usage/controller';
import { authOutLinkChatStart } from '@/service/support/permission/auth/outLink';
import { pushResult2Remote, addOutLinkUsage } from '@fastgpt/service/support/outLink/tools';
import requestIp from 'request-ip';
@@ -423,7 +423,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
}
// add record
const { totalPoints } = pushChatUsage({
const { totalPoints } = createChatUsage({
appName: app.name,
appId: app._id,
teamId,