
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@brainstack/agent
Advanced tools
Brainstack Model Agent Library
The @brainstack/agent
library is an abstraction layer to interact with various language model services. It simplifies the integration of OpenAI's GPT and Azure AI services into your applications, making it effortless to query these services and receive text-based responses.
To use the @brainstack/agent
library, you need to install it using npm:
npm install @brainstack/agent
The ModelService
class acts as a central interface for querying language model services. It abstracts the integration details and allows you to focus on asking questions. Here's an example of how to use it with OpenAI's:
import { ModelService, IntegrationOpenAI } from '@brainstack/agent';
const openaiLLMIntegration = new IntegrationOpenAI('your_openai_api_key');
const llmService = new ModelService(openaiLLMIntegration);
const userQuestion = 'What is the weather today?';
const llmResponse = await llmService.ask(userQuestion);
console.log('User Question:', userQuestion);
console.log('LLM Response:', llmResponse);
Similarly, you can use the ModelService
with the Azure AI integration:
import { ModelService, IntegrationAzure } from '@brainstack/agent';
const azureLLMIntegration = new IntegrationAzure('your_azure_api_key', 'your_azure_api_endpoint');
const llmService = new ModelService(azureLLMIntegration);
const userQuestion = 'Tell me about the solar system.';
const llmResponse = await llmService.ask(userQuestion);
console.log('User Question:', userQuestion);
console.log('LLM Response:', llmResponse);
Before using the library, make sure you have the required API keys or endpoints for the selected integration.
This project is licensed under the MIT License. You can find more details in the LICENSE file.
FAQs
Brainstack Model Agent Lib
The npm package @brainstack/agent receives a total of 0 weekly downloads. As such, @brainstack/agent popularity was classified as not popular.
We found that @brainstack/agent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.