update examples, update package-lock.json
This commit is contained in:
parent
6079cd8307
commit
e1abdab7f5
1 changed files with 258 additions and 431 deletions
|
|
@ -341,19 +341,13 @@ async function callTool(name: string, args: Record<string, unknown>): Promise<vo
|
|||
});
|
||||
|
||||
console.log('Tool result:');
|
||||
if (result.content) {
|
||||
result.content.forEach(item => {
|
||||
if (item.type === 'text') {
|
||||
console.log(` ${item.text}`);
|
||||
} else {
|
||||
console.log(` ${item.type} content:`, item);
|
||||
}
|
||||
});
|
||||
} else if (result.structuredContent) {
|
||||
console.log(` Structured content: ${result.structuredContent}`);
|
||||
} else {
|
||||
console.log(' No content returned');
|
||||
}
|
||||
result.content?.forEach(item => {
|
||||
if (item.type === 'text') {
|
||||
console.log(` ${item.text}`);
|
||||
} else {
|
||||
console.log(` ${item.type} content:`, item);
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(`Error calling tool ${name}: ${error}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue