mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
bandaid for broken mcp calls (#732)
This commit is contained in:
@@ -128,6 +128,10 @@ export function formatLlmContentForFunctionResponse(
|
|||||||
additionalParts.push(contentToProcess);
|
additionalParts.push(contentToProcess);
|
||||||
} else if (contentToProcess.text !== undefined) {
|
} else if (contentToProcess.text !== undefined) {
|
||||||
functionResponseJson = { output: contentToProcess.text };
|
functionResponseJson = { output: contentToProcess.text };
|
||||||
|
} else if (contentToProcess.functionResponse) {
|
||||||
|
functionResponseJson = JSON.parse(
|
||||||
|
JSON.stringify(contentToProcess.functionResponse),
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
functionResponseJson = { status: 'Tool execution succeeded.' };
|
functionResponseJson = { status: 'Tool execution succeeded.' };
|
||||||
additionalParts.push(contentToProcess);
|
additionalParts.push(contentToProcess);
|
||||||
|
|||||||
@@ -96,10 +96,9 @@ This MCP tool named '${serverToolName}' was discovered from '${serverName}' MCP
|
|||||||
|
|
||||||
const responseParts: Part[] = await this.mcpTool.callTool(functionCalls);
|
const responseParts: Part[] = await this.mcpTool.callTool(functionCalls);
|
||||||
|
|
||||||
const output = getStringifiedResultForDisplay(responseParts);
|
|
||||||
return {
|
return {
|
||||||
llmContent: responseParts,
|
llmContent: responseParts,
|
||||||
returnDisplay: output,
|
returnDisplay: getStringifiedResultForDisplay(responseParts),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user