Removed <tool> blocks from responses
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/ai-utils",
|
"name": "@ztimson/ai-utils",
|
||||||
"version": "1.3.3",
|
"version": "1.3.4",
|
||||||
"description": "AI Utility library",
|
"description": "AI Utility library",
|
||||||
"author": "Zak Timson",
|
"author": "Zak Timson",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ export class Anthropic extends LLMProvider {
|
|||||||
const turnStart = history.map(h => h.role).lastIndexOf('user');
|
const turnStart = history.map(h => h.role).lastIndexOf('user');
|
||||||
const finalContent = history.slice(turnStart + 1).reduce((str, h) => {
|
const finalContent = history.slice(turnStart + 1).reduce((str, h) => {
|
||||||
if(h.role === 'assistant') return str + (h.content || '');
|
if(h.role === 'assistant') return str + (h.content || '');
|
||||||
if(h.role === 'tool') return str + `<tool>${h.name}</tool>\n\n`;
|
|
||||||
return str;
|
return str;
|
||||||
}, '').trim();
|
}, '').trim();
|
||||||
|
|
||||||
|
|||||||
@@ -190,7 +190,6 @@ export class OpenAi extends LLMProvider {
|
|||||||
const turnStart = history.map(h => h.role).lastIndexOf('user');
|
const turnStart = history.map(h => h.role).lastIndexOf('user');
|
||||||
const finalContent = history.slice(turnStart + 1).reduce((str, h) => {
|
const finalContent = history.slice(turnStart + 1).reduce((str, h) => {
|
||||||
if(h.role === 'assistant') return str + (h.content || '');
|
if(h.role === 'assistant') return str + (h.content || '');
|
||||||
if(h.role === 'tool') return str + `<tool>${h.name}</tool>\n\n`;
|
|
||||||
return str;
|
return str;
|
||||||
}, '').trim();
|
}, '').trim();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user