UNPKG

tinyagent-ts

Version:

Modern TypeScript framework for building AI agents with pluggable tools and ReAct reasoning

16 lines 650 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const scratchpad_1 = require("../src/utils/scratchpad"); describe('Scratchpad', () => { it('renders steps to messages', () => { const pad = new scratchpad_1.Scratchpad(); pad.setTask('Do it'); pad.addThought('think'); pad.addAction({ type: 'action', mode: 'json', tool: 't', args: { a: 1 } }); pad.addObservation('ok'); pad.addReflexion('oops'); const msgs = pad.toMessages('sys'); expect(msgs[msgs.length - 1].content).toContain('Reflexion: oops'); }); }); //# sourceMappingURL=scratchpad.test.js.map