mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-02 03:00:15 -04:00
Update everything server to sampling output (can now be array of content)
This commit is contained in:
@@ -619,9 +619,13 @@ export const createServer = () => {
|
||||
maxTokens,
|
||||
extra.sendRequest
|
||||
);
|
||||
const content = Array.isArray(result.content) ? result.content : [result.content];
|
||||
const textResult = content.every((c) => c.type === "text")
|
||||
? content.map(c => c.text).join("\n")
|
||||
: JSON.stringify(result.content);
|
||||
return {
|
||||
content: [
|
||||
{ type: "text", text: `LLM sampling result: ${result.content.text}` },
|
||||
{ type: "text", text: `LLM sampling result: ${textResult}` },
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user