Files
ai-utils/main.mjs
ztimson 51ab8f2538
All checks were successful
Publish Library / Build NPM Project (push) Successful in 52s
Publish Library / Tag Version (push) Successful in 14s
Memory / history fixes
2026-06-07 21:35:26 -04:00

26 lines
682 B
JavaScript

import {Ai} from './dist/index.mjs';
const ai = new Ai({
path: './',
llm: {
system: 'You are a testbed for developing an AI library',
models: {
'qwen/qwen3.5-9b': {proto: 'openai', host: 'http://127.0.0.1:1234/v1'}
}
}
});
const skills = [{
name: 'Momentum',
description: 'Learn how to use the Momentum API',
content: 'You can initialize it with: new Momentum(url);'
}];
const history = [], memory = [];
await ai.language.ask('My favorite color is red', {history, memory});
await ai.language.updateMemory(history, memory);
history.splice(0, history.length);
console.log(await ai.language.ask('Whats my favorite color?', {history, memory}));
console.log(history);