Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
qb-ai-translate
Advanced tools
Readme
The qb-ai-translate is a npm package that provide logic to translate message to selected language using Chat Gpt.
QBAITranslate can be installed using Node Package Manager. To include it in your JS based project, follow these command:
npm install qb-ai-translate
To use QBAITranslate in your project, follow these steps:
import { ChatMessage } from 'qb-ai-core';
import { AITranslateSettings, QBAITranslate } from 'qb-ai-translate';
ChatMessage
objects representing the chat history:let prompt = "YOUR_TEXT_TO_TRANSLATE";
let messages = [
{role: Role.other, content: "Hello, Bob!"},
{role: Role.me, content: "Hi, Jim!"},
{role: Role.me, content: prompt},
]
or
let prompt = "YOUR_TEXT_TO_TRANSLATE";
let messages = [
{role: "assistant", content: "Hello, Bob!"},
{role: "user", content: "Hi, Jim!"},
{role: "user", content: prompt},
]
translate
method to generate translate using an API key: const settings: AITranslateSettings =
QBAITranslate.createDefaultAITranslateSettings();
settings.apiKey = 'YOUR_OPEN_AI_API_KEY';
settings.organization = 'YOUR_ORGANIZATION';// might be empty
settings.model = AIModel.gpt__3_5__turbo;
settings.language = 'LNAGUAGE'; // in BCP47 format
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/languages
// https://datatracker.ietf.org/doc/html/rfc5646
return QBAITranslate.translate(
promt,
messages,
settings,
);
Alternatively, you can use a QuickBlox user token and a proxy URL for more secure communication:
const settings: AITranslateSettings =
QBAITranslate.createDefaultAITranslateSettings();
settings.organization = 'YOUR_ORGANIZATION';// might be empty
settings.model = AIModel.gpt__3_5__turbo;
settings.token = 'YOUR_QUICKBLOX_USER_SESSION_TOKEN';
settings.language = 'LNAGUAGE';
settings.serverPath = `https://your-proxy-server-url`;
return QBAITranslate.translate(
promt,
messages,
settings,
);
To use the OpenAI API and generate answers, you need to obtain an API key from OpenAI. Follow these steps to get your API key:
Using a proxy server like the QuickBlox AI Assistant Proxy Server offers significant benefits in terms of security and functionality:
Enhanced Security:
Protection of API Keys:
Rate Limiting and Throttling:
Request Logging and Monitoring:
Flexibility and Customization:
SSL/TLS Encryption:
QBAITranslate is released under the MIT License.
We welcome contributions to improve QBAIAnswerAssistant. If you find any issues or have suggestions, feel free to open an issue or submit a pull request on GitHub. Join our Discord Server: https://discord.gg/GrynPeHMaa
Happy coding! 🚀
FAQs
Quickblox AI Translate library
The npm package qb-ai-translate receives a total of 59 weekly downloads. As such, qb-ai-translate popularity was classified as not popular.
We found that qb-ai-translate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.