fix: normalize ollama tool calls from content and thinking
This commit is contained in:
@@ -45,4 +45,17 @@ hello
|
||||
const result = parseXmlToolCalls(content);
|
||||
expect(result).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('parses JSON tool calls wrapped in tool_call tags', () => {
|
||||
const content = `
|
||||
<tool_call>
|
||||
{"name":"read","arguments":{"path":"/tmp/test.txt"}}
|
||||
</tool_call>
|
||||
`;
|
||||
|
||||
const result = parseXmlToolCalls(content);
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0].name).toBe('read');
|
||||
expect(result[0].args).toEqual({ path: '/tmp/test.txt' });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user