mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
add lang
This commit is contained in:
parent
7a26cd8a7c
commit
38bf40d710
|
|
@ -94,6 +94,7 @@ type Response = DispatchNodeResultType<{
|
|||
export const dispatchRunAgent = async (props: DispatchAgentModuleProps): Promise<Response> => {
|
||||
let {
|
||||
node: { nodeId, name, isEntry, version, inputs },
|
||||
lang,
|
||||
runtimeNodes,
|
||||
runtimeEdges,
|
||||
histories,
|
||||
|
|
@ -160,7 +161,7 @@ export const dispatchRunAgent = async (props: DispatchAgentModuleProps): Promise
|
|||
};
|
||||
};
|
||||
|
||||
const subAppList = await getSubApps({ subApps: runtimeSubApps, urls: fileLinks });
|
||||
const subAppList = await getSubApps({ subApps: runtimeSubApps, urls: fileLinks, lang });
|
||||
console.log(JSON.stringify(subAppList, null, 2));
|
||||
// const combinedSystemPrompt = `${parseAgentSystem({ systemPrompt, toolNodesMap })}\n\n${getTopAgentConstantPrompt()}`;
|
||||
|
||||
|
|
@ -262,7 +263,11 @@ export const dispatchRunAgent = async (props: DispatchAgentModuleProps): Promise
|
|||
handleToolResponse: async ({ call, messages }) => {
|
||||
const toolId = call.function.name;
|
||||
|
||||
const { response, usages, isEnd } = await (async () => {
|
||||
const {
|
||||
response,
|
||||
usages = [],
|
||||
isEnd
|
||||
} = await (async () => {
|
||||
if (toolId === SubAppIds.stop) {
|
||||
return {
|
||||
response: '',
|
||||
|
|
|
|||
|
|
@ -16,12 +16,15 @@ import type { RuntimeNodeItemType } from '@fastgpt/global/core/workflow/runtime/
|
|||
import { MongoApp } from '../../../../../app/schema';
|
||||
import { getMCPChildren } from '../../../../../app/mcp';
|
||||
import { getMCPToolRuntimeNode } from '@fastgpt/global/core/app/mcpTools/utils';
|
||||
import type { localeType } from '@fastgpt/global/common/i18n/type';
|
||||
|
||||
export const getSubApps = async ({
|
||||
subApps,
|
||||
lang,
|
||||
urls
|
||||
}: {
|
||||
subApps: RuntimeNodeItemType[];
|
||||
lang?: localeType;
|
||||
urls?: string[];
|
||||
}): Promise<ChatCompletionTool[]> => {
|
||||
// System Tools: Plan Agent, stop sign, model agent.
|
||||
|
|
@ -101,7 +104,7 @@ export const getSubApps = async ({
|
|||
if (systemToolId) {
|
||||
const children = await getSystemToolRunTimeNodeFromSystemToolset({
|
||||
toolSetNode: node,
|
||||
lang: 'en'
|
||||
lang
|
||||
});
|
||||
return getToolNode(children);
|
||||
} else if (mcpToolsetVal) {
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ export type DispatchSubAppProps<T> = {
|
|||
};
|
||||
export type DispatchSubAppResponse = {
|
||||
response: string;
|
||||
usages: ChatNodeUsageType[];
|
||||
usages?: ChatNodeUsageType[];
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue