bandaid for broken mcp calls (#732)
This commit is contained in:
parent
12059eb4ca
commit
80a445c7ae
|
@ -128,6 +128,10 @@ export function formatLlmContentForFunctionResponse(
|
|||
additionalParts.push(contentToProcess);
|
||||
} else if (contentToProcess.text !== undefined) {
|
||||
functionResponseJson = { output: contentToProcess.text };
|
||||
} else if (contentToProcess.functionResponse) {
|
||||
functionResponseJson = JSON.parse(
|
||||
JSON.stringify(contentToProcess.functionResponse),
|
||||
);
|
||||
} else {
|
||||
functionResponseJson = { status: 'Tool execution succeeded.' };
|
||||
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 output = getStringifiedResultForDisplay(responseParts);
|
||||
return {
|
||||
llmContent: responseParts,
|
||||
returnDisplay: output,
|
||||
returnDisplay: getStringifiedResultForDisplay(responseParts),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue