morfy-ai v1.1.1
Morfy.ai - AI Integration Library
Morfy.ai is a JavaScript library designed for AI integration, including functionality to interact with OpenAI, Gemini, DeepSeek, and other AI services. It allows seamless integration into your project for tasks like sending messages, generating photos, translating text, and more.
Features
- Send messages to AI services such as DeepSeek, Gemini, and OpenAI.
- Translate text with Translatte.
- Generate photos with Photo AI.
- Easy-to-use API key management.
Installation
You can install Morfy.ai via npm:
npm install morfy-ai
Usage
Loading the API Key
Before calling any function, you need to load a valid API key using the morfy.load(apiKey)
method. The API key is verified by checking it against a list of valid keys stored on a remote server.
Example:
const morfy = require('morfy-ai');
// Load the API key (must be a valid key with at least 32 characters)
morfy.load('your-api-key-here');
Get an API key by leaving a comment with "code" at the following link: [LINK]
Sending Messages to AI Services
You can send messages to different AI services by calling the respective functions. The message format used is OpenAI's message format, which is an array of objects. Each message object should contain a role
(either user
, system
, or assistant
) and a content
field.
Example:
const messages = [
{
role: 'user',
content: 'What is the weather like today?'
}
];
async function sendMessages() {
try {
// Отправка сообщения в DeepSeek (r1)
const deepSeekResponse = await morfy.deepseek.r1.sendMessage(messages);
console.log(deepSeekResponse);
// Отправка сообщения в OpenAI (v1)
const openAiResponse = await morfy.openai.v1.sendMessage(messages);
console.log(openAiResponse);
} catch (err) {
console.error(err);
}
}
// Вызов функции
sendMessages();
Available Services
DeepSeek
- r1: Send messages using DeepSeek's r1 model.
morfy.deepseek.r1.sendMessage(messages)
Gemini
- v2: Send messages using Gemini v2 model.
morfy.gemini.v2.sendMessage(messages)
OpenAI
- 4o: Send messages using OpenAi 4o model.
morfy.openai.v1.sendMessage(messages)
DeepSeek
- r1: Send messages using DeepSeek R1 model.
morfy.deepseek.r1.sendMessage(messages)
Photo-Ai
- v1: Generate a photo based on a given prompt.
morfy.photo.v1.generatePhoto('A futuristic city skyline at sunset')
Translate
- v1: Translate text to a different language.
morfy.translate.v1.translateText('Hello, how are you?', 'de')
🚀 Beta Version Notice
This library is currently in beta. We are actively working on improving its performance, stability, and features. While we strive for quality, you may encounter bugs or unexpected behavior.
Your feedback is invaluable! If you find any issues, please report them so we can enhance the library for future releases.
Stay tuned for updates as we continue to refine and improve Morfy-AI! 🔥