https://github.com/otoneko1102/unlimited-ai
Provides unlimited AI answers for Node.js.
https://github.com/otoneko1102/unlimited-ai
ai bard free gemini gen generate gpt gpt3 gpt4 gpt4o nodejs npm package unlimited
Last synced: 10 days ago
JSON representation
Provides unlimited AI answers for Node.js.
- Host: GitHub
- URL: https://github.com/otoneko1102/unlimited-ai
- Owner: otoneko1102
- Created: 2024-08-27T03:27:53.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-04-09T15:55:06.000Z (14 days ago)
- Last Synced: 2025-04-09T16:51:23.783Z (14 days ago)
- Topics: ai, bard, free, gemini, gen, generate, gpt, gpt3, gpt4, gpt4o, nodejs, npm, package, unlimited
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/unlimited-ai
- Size: 54.7 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
    
[](https://nodei.co/npm/unlimited-ai/)
# unlimited-ai
Provides unlimited AI answers for Node.js.
Powered by [Voids API](https://voids.top/).> ⚠ At the request of the Voids API owner, the specifications of some functions have been changed. ⚠
> ⚠ The Voids API owner has stated that an API key will be required in the future. ⚠
> Note: The Voids API is not owned or operated by the developer of this package, so please do not contact us through GitHub Issues or other such inquiries about the API being down.
## Usage
- Example with class: [class.js](https://github.com/otoneko1102/unlimited-ai/tree/main/examples/class.js)
- Example (gemini): [gemini.js](https://github.com/otoneko1102/unlimited-ai/tree/main/examples/gemini.js)
- Example (gpt): [gpt-4.js](https://github.com/otoneko1102/unlimited-ai/tree/main/examples/gpt-4.js)
- Example with search: [with-search.js](https://github.com/otoneko1102/unlimited-ai/tree/main/examples/with-search.js)### AI(format?: { model?: string, messages?: Array\<{ role: string, content: string }\> })
#### setModel(model: string, search?: boolean, all?: boolean): AI
#### setMessages(messages: Array\<{ role: string, content: string }\>): AI
#### addMessage(message: { role: string, content: string }): AI
#### removeMessage(index: Integer): AI
#### generate(raw?: boolean): Promise\
#### getFormat(): { model?: string, messages?: Array\<{ role: string, content: string }\> }```js
// Example
// The model name in this example may be out of date.
// Please check with .models() or .allModels() for the latest information.const { AI } = require('unlimited-ai');
(async () => {
const ai = new AI();
ai
.setModel('gpt-4-turbo-2024-04-09')
.addMessage({ role: 'user', content: 'Hello!' })
.addMesssage({ role: 'system', content: 'You are a 12-year-old girl.' })console.log(await ai.generate()); // 'Hello there! How can I be of assistance to you today?'
})();
```### .generate(model, messages, raw): Promise\
Return string of AI answers (if raw is true, return object).
```js
// Example
// The model name in this example may be out of date.
// Please check with .models() or .allModels() for the latest information.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(): Promise\
Return array of available models.### .allModels(): Promise\
Return array of all models.### .searchModels(word, all): Promise\
Search models.#### word: string
Search keywords.#### all?: boolean (default: false)
Search from all or available.### .config: object
Return URLs.## Change Log
### 5.x --> 6.0.0
Class has been added.
### 4.x --> 5.0.0
Model search function added.
### 3.x --> 4.0.0
`.models` is no longer supported and has been replaced by `.models()`.
### 2.x --> 3.0.0
Developers and development groups have been listed. Features have been optimized.
### 1.x --> 2.0.0
TypeScript supported!
### 0.x --> 1.0.0
Package released!