mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(Basic LLM Chain Node): Use JSON parsing for Claude 3.7 with thinking enabled (#15381)
This commit is contained in:
@@ -62,6 +62,20 @@ describe('chainExecutor', () => {
|
||||
const parser = chainExecutor.getOutputParserForLLM(regularModel);
|
||||
expect(parser).toBeInstanceOf(StringOutputParser);
|
||||
});
|
||||
|
||||
it('should return NaiveJsonOutputParser for Anthropic models in thinking mode', () => {
|
||||
const model = {
|
||||
lc_kwargs: {
|
||||
invocationKwargs: {
|
||||
thinking: {
|
||||
type: 'enabled',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
const parser = chainExecutor.getOutputParserForLLM(model as unknown as BaseChatModel);
|
||||
expect(parser).toBeInstanceOf(NaiveJsonOutputParser);
|
||||
});
|
||||
});
|
||||
|
||||
describe('NaiveJsonOutputParser', () => {
|
||||
|
||||
Reference in New Issue
Block a user