1.0.6 • Published 2 months ago

sakura.ai v1.0.6

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
2 months ago

SakuraAI Node.js Module

Sakura is a Node.js module that provides easy access to the SakuraAI API to create text, analysis, and visuals using various models.

Installation

You can install SakuraAI via npm:

npm install sakura.ai

Usage

const { SakuraAI } = require('sakura.ai');

// Initialize SakuraAI with your API key
const sakura = new SakuraAI('your-api-key');

// Example usage of the `kirai` method
sakura.kirai({
    model: 'SBT-1',
    content: 'How does the universe work?',
    username: 'user123'
}).then(response => {
    console.log(response.reply);
});

// Example usage of the `kiraiTeach` method
sakura.kiraiTeach({
    question:"Hello, how are you Sakura?",
    answer:"Thank you, I'm fine, how are you {skruser}?"
    }).then(response => {
        console.log(response.message)
    })


// Example usage of the `kazuki` method
sakura.kazuki({
    model: 'SBIA-1',
    prompt: 'A beautiful sunset over the ocean',
    negative: 'dark and gloomy',
    style: 'cinematic',
    seed: 12345
}).then(response => {
    console.log(response.imageUrl);
});

// Example usage of the `hanami` method
sakura.hanami({
    content:"Hello"
}).then(response => {
    console.log(response)
})

Methods

kirai({ model, content, username })

Generate text using the Kirai model.

  • model (string): The model to use (SBT-1 or SBT-2).
  • content (string): The content or question for generating text.
  • username (string): The username associated with the request.

kiraiTeach({ question, answer })

Teach the Kirai model with a new question and answer.

  • question (string): The question to teach the model.
  • answer (string): The answer for the question.

kazuki({ model, prompt, negative, style })

Generate images using the Kazuki model.

  • model (string): The model to use (SBIA-1, SBIA-2, or SBIA-3).
  • prompt (string): The prompt or description for generating images.
  • negative (string, optional): A negative prompt for the model.
  • style (string, optional): Style presets for image generation.
  • seed (number, optional): The seed for randomization.

hanami({ content })

Analyze text sentiment using the Hanami model.

  • content (string): The text content to analyze.

Auto Update

The module includes an auto-update feature that checks for the latest version of the module on npm and updates automatically if a new version is available.

const { autoUpdate } = require('sakura.ai');

// Check for updates
autoUpdate()

License

This module is licensed under the MIT License. See the LICENSE file for details.

API Key

To get an API key, you just need to join the discord server and use the /create-key command.