mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-14 15:11:13 +00:00
feat: add toolDescription field across various schemas and update related functions (#5452)
This commit is contained in:
@@ -314,7 +314,11 @@ export async function getChildAppPreviewNode({
|
||||
}))
|
||||
}
|
||||
}
|
||||
: { systemTool: { toolId: app.id } })
|
||||
: {
|
||||
systemTool: {
|
||||
toolId: app.id
|
||||
}
|
||||
})
|
||||
},
|
||||
showSourceHandle: app.isFolder ? false : true,
|
||||
showTargetHandle: app.isFolder ? false : true
|
||||
@@ -368,6 +372,7 @@ export async function getChildAppPreviewNode({
|
||||
avatar: app.avatar,
|
||||
name: parseI18nString(app.name, lang),
|
||||
intro: parseI18nString(app.intro, lang),
|
||||
toolDescription: app.toolDescription,
|
||||
courseUrl: app.courseUrl,
|
||||
userGuide: app.userGuide,
|
||||
showStatus: true,
|
||||
@@ -462,8 +467,17 @@ export async function getChildAppRuntimeById({
|
||||
}
|
||||
|
||||
const dbPluginFormat = (item: SystemPluginConfigSchemaType): SystemPluginTemplateItemType => {
|
||||
const { name, avatar, intro, version, weight, templateType, associatedPluginId, userGuide } =
|
||||
item.customConfig!;
|
||||
const {
|
||||
name,
|
||||
avatar,
|
||||
intro,
|
||||
toolDescription,
|
||||
version,
|
||||
weight,
|
||||
templateType,
|
||||
associatedPluginId,
|
||||
userGuide
|
||||
} = item.customConfig!;
|
||||
|
||||
return {
|
||||
id: item.pluginId,
|
||||
@@ -475,6 +489,7 @@ const dbPluginFormat = (item: SystemPluginConfigSchemaType): SystemPluginTemplat
|
||||
name,
|
||||
avatar,
|
||||
intro,
|
||||
toolDescription,
|
||||
weight,
|
||||
templateType,
|
||||
originCost: item.originCost,
|
||||
@@ -556,6 +571,7 @@ export const getSystemTools = async (): Promise<SystemPluginTemplateItemType[]>
|
||||
name: item.name,
|
||||
avatar: item.avatar,
|
||||
intro: item.description,
|
||||
toolDescription: item.toolDescription,
|
||||
author: item.author,
|
||||
courseUrl: item.courseUrl,
|
||||
instructions: dbPluginConfig?.customConfig?.userGuide,
|
||||
|
1
packages/service/core/app/plugin/type.d.ts
vendored
1
packages/service/core/app/plugin/type.d.ts
vendored
@@ -17,6 +17,7 @@ export type SystemPluginConfigSchemaType = {
|
||||
name: string;
|
||||
avatar: string;
|
||||
intro?: string;
|
||||
toolDescription?: string;
|
||||
version: string;
|
||||
weight?: number;
|
||||
templateType: string;
|
||||
|
@@ -189,7 +189,7 @@ export const runToolWithFunctionCall = async (
|
||||
|
||||
return {
|
||||
name: item.nodeId,
|
||||
description: item.intro,
|
||||
description: item.toolDescription || item.intro,
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties,
|
||||
|
@@ -193,7 +193,7 @@ export const runToolWithPromptCall = async (
|
||||
|
||||
return {
|
||||
toolId: item.nodeId,
|
||||
description: item.intro,
|
||||
description: item.toolDescription || item.intro,
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties,
|
||||
|
@@ -246,7 +246,7 @@ export const runToolWithToolChoice = async (
|
||||
type: 'function',
|
||||
function: {
|
||||
name: item.nodeId,
|
||||
description: item.intro || item.name,
|
||||
description: item.toolDescription || item.intro || item.name,
|
||||
parameters: {
|
||||
type: 'object',
|
||||
properties,
|
||||
|
@@ -3,7 +3,7 @@
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@fastgpt-sdk/plugin": "^0.1.8",
|
||||
"@fastgpt-sdk/plugin": "^0.1.9",
|
||||
"@fastgpt/global": "workspace:*",
|
||||
"@modelcontextprotocol/sdk": "^1.12.1",
|
||||
"@node-rs/jieba": "2.0.1",
|
||||
|
Reference in New Issue
Block a user