@pr4j3sh/ai
v1.0.7
Published
ai in your code
Maintainers
Readme
ai
ai in your code
This is a javascript npm package for using LLM inside your code.
Supports:
- SheCodes
- Ollama
Use chaining to make context aware
Installation
- Using
npm
npm i @pr4j3sh/aiUsage
- Server side
const AI = require("@pr4j3sh/ai");
async function main() {
try {
const ai = new AI("write two lines on javascript");
await ai.shecodes();
await ai.ollama(
`${ai.response}\n use the above and give me two mcqs on it`,
);
console.log(ai.response);
} catch (error) {
console.error(error.message);
}
}
main();- Client side
import AI from "@pr4j3sh/ai";
async function main() {
try {
const ai = new AI("write two lines on javascript");
await ai.shecodes();
await ai.ollama(
`${ai.response}\n use the above and give me two mcqs on it`,
);
console.log(ai.response);
} catch (error) {
console.error(error.message);
}
}
main();