mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-19 18:14:38 +00:00
@@ -386,6 +386,7 @@ export const runToolCall = async (
|
|||||||
initToolNodes(runtimeNodes, [toolNode.nodeId], startParams);
|
initToolNodes(runtimeNodes, [toolNode.nodeId], startParams);
|
||||||
const toolRunResponse = await runWorkflow({
|
const toolRunResponse = await runWorkflow({
|
||||||
...workflowProps,
|
...workflowProps,
|
||||||
|
usageId: undefined,
|
||||||
isToolCall: true
|
isToolCall: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -8,52 +8,60 @@ import {
|
|||||||
} from '@fastgpt/global/support/user/team/constant';
|
} from '@fastgpt/global/support/user/team/constant';
|
||||||
import { UsageCollectionName, UsageItemCollectionName } from './constants';
|
import { UsageCollectionName, UsageItemCollectionName } from './constants';
|
||||||
|
|
||||||
const UsageSchema = new Schema({
|
const UsageSchema = new Schema(
|
||||||
teamId: {
|
{
|
||||||
type: Schema.Types.ObjectId,
|
teamId: {
|
||||||
ref: TeamCollectionName,
|
type: Schema.Types.ObjectId,
|
||||||
required: true
|
ref: TeamCollectionName,
|
||||||
},
|
required: true
|
||||||
tmbId: {
|
},
|
||||||
type: Schema.Types.ObjectId,
|
tmbId: {
|
||||||
ref: TeamMemberCollectionName,
|
type: Schema.Types.ObjectId,
|
||||||
required: true
|
ref: TeamMemberCollectionName,
|
||||||
},
|
required: true
|
||||||
source: {
|
},
|
||||||
type: String,
|
source: {
|
||||||
enum: Object.values(UsageSourceEnum),
|
type: String,
|
||||||
required: true
|
enum: Object.values(UsageSourceEnum),
|
||||||
},
|
required: true
|
||||||
appName: {
|
},
|
||||||
// usage name
|
appName: {
|
||||||
type: String,
|
// usage name
|
||||||
default: ''
|
type: String,
|
||||||
},
|
default: ''
|
||||||
totalPoints: {
|
},
|
||||||
// total points
|
totalPoints: {
|
||||||
type: Number,
|
// total points
|
||||||
required: true
|
type: Number,
|
||||||
},
|
required: true
|
||||||
appId: {
|
},
|
||||||
type: Schema.Types.ObjectId,
|
appId: {
|
||||||
ref: 'apps',
|
type: Schema.Types.ObjectId,
|
||||||
required: false
|
ref: 'apps',
|
||||||
},
|
required: false
|
||||||
pluginId: {
|
},
|
||||||
type: Schema.Types.ObjectId,
|
pluginId: {
|
||||||
ref: 'plugins',
|
type: Schema.Types.ObjectId,
|
||||||
required: false
|
ref: 'plugins',
|
||||||
},
|
required: false
|
||||||
time: {
|
},
|
||||||
type: Date,
|
time: {
|
||||||
default: () => new Date()
|
type: Date,
|
||||||
},
|
default: () => new Date()
|
||||||
|
},
|
||||||
|
|
||||||
// @description It will not be used again in the future.
|
// @description It will not be used again in the future.
|
||||||
list: {
|
list: {
|
||||||
type: Array
|
type: Array
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Auto update time
|
||||||
|
timestamps: {
|
||||||
|
updatedAt: 'time'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
|
|
||||||
UsageSchema.virtual('usageItems', {
|
UsageSchema.virtual('usageItems', {
|
||||||
ref: UsageItemCollectionName,
|
ref: UsageItemCollectionName,
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
import type { ConcatUsageProps } from '@fastgpt/global/support/wallet/usage/api';
|
|
||||||
|
|
||||||
declare global {
|
|
||||||
var reduceAiPointsQueue: { teamId: string; totalPoints: number }[];
|
|
||||||
var concatBillQueue: ConcatUsageProps[];
|
|
||||||
}
|
|
Reference in New Issue
Block a user