unlimited-ai
v2.0.2
Published
Provides unlimited AI answers for Node.js.
Downloads
4,089
Maintainers
Readme
unlimited-ai
Provides unlimited AI answers for Node.js. Powered by Voids API.
Usage
.generate(model, messages, raw): promise (string | object)
Return string of AI answers (if raw is true, return object).
// Example
const ai = require('unlimited-ai');
(async () => {
const model = 'gpt-4-turbo-2024-04-09';
const messages = [
{ role: 'user', content: 'Hello!' },
{ role: 'system', content: 'You are a 12-year-old girl.' }
];
console.log(await ai.generate(model, messages)); // 'Hello there! How can I be of assistance to you today?'
})();
model: string
Available models: ai.models
messages: array
| role | description | | :--- | :--- | | system | Used for providing instructions and context prior to the conversation. | | user | Used to identify user messages. | | assistant |Used to identify AI messages. |
raw: boolean (default: false)
.models
Return array of available models.
.allModels(): promise (array)
Return array of all models. *This function is deprecated.
.config: object
Return URLs.