
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
@deepracticex/ai-chat
Advanced tools
Universal AI chat client with intelligent tool calling format adapter - supports OpenAI, Claude, Kimi, and any OpenAI-compatible APIs with robust error handling
A focused AI chat client for handling AI requests and tool calling in Node.js applications.
@ai-chat is designed with a clear focus on core AI interaction:
This package does NOT handle:
model-manager packages)config-manager)context-manager)context-manager)context-manager)mcp-client or custom providers)import { AIChat } from '@deepracticex/ai-chat'
// ✨ Simple and direct - specify exactly what you need
const aiChat = new AIChat({
baseUrl: 'https://api.openai.com/v1',
model: 'gpt-4',
apiKey: process.env.OPENAI_API_KEY
})
// 🌐 Works with any OpenAI-compatible API
const claude = new AIChat({
baseUrl: 'https://api.anthropic.com/v1',
model: 'claude-3-sonnet-20240229',
apiKey: process.env.CLAUDE_API_KEY
})
const azure = new AIChat({
baseUrl: 'https://your-resource.openai.azure.com',
model: 'gpt-4',
apiKey: process.env.AZURE_OPENAI_KEY
})
const ollama = new AIChat({
baseUrl: 'http://localhost:11434',
model: 'llama3'
// No API key needed for local services
})
// 🚀 Send streaming messages
for await (const chunk of aiChat.sendMessage(messages)) {
if (chunk.content) process.stdout.write(chunk.content)
if (chunk.done) break
}
class AIChat {
constructor(config: AIChatConfig)
// Send message and get complete response
sendMessage(
messages: Message[],
options?: ChatOptions
): Promise<ChatResponse>
// Send message and get streaming response
sendMessageStream(
messages: Message[],
options?: ChatOptions
): AsyncIterable<ChatStreamChunk>
}
Direct and explicit configuration - no magic, no guessing:
interface AIChatConfig {
baseUrl: string // API service endpoint URL - always required
model: string // Model name - always required
apiKey?: string // API key - optional for local services
temperature?: number
maxTokens?: number
}
// ✅ Examples - Clear and explicit
{
baseUrl: 'https://api.openai.com/v1',
model: 'gpt-4',
apiKey: 'sk-...'
}
{
baseUrl: 'https://api.anthropic.com/v1',
model: 'claude-3-sonnet-20240229',
apiKey: 'sk-ant-...'
}
{
baseUrl: 'http://localhost:11434',
model: 'llama3'
// No API key needed for local Ollama
}
Models and providers are managed externally - use dedicated packages for configuration:
// ✅ Get configuration from external model management
import { getModelConfig } from '@deechat/model-manager'
const modelConfig = await getModelConfig({
task: 'coding',
preference: 'fastest'
})
const aiChat = new AIChat(modelConfig)
// modelConfig = {
// baseUrl: 'https://api.openai.com/v1',
// model: 'gpt-4-turbo',
// apiKey: '...'
// }
// ✅ Or use provider configuration helpers
import { openaiConfig, claudeConfig } from '@deechat/provider-configs'
const aiChat = new AIChat(
openaiConfig('gpt-4', { apiKey: process.env.OPENAI_KEY })
)
// Tools are provided as input, not discovered by this package
const response = await aiChat.sendMessage(messages, {
tools: [
{
name: "search_files",
description: "Search for files",
parameters: { /* JSON Schema */ }
}
],
onToolCall: async (call) => {
// Your tool execution logic here
// This could call mcp-client, local functions, etc.
return {
toolCallId: call.id,
result: await executeMyTool(call.name, call.arguments)
}
}
})
const stream = aiChat.sendMessageStream(messages, {
tools: myTools,
onToolCall: handleToolCall
})
for await (const chunk of stream) {
if (chunk.content) {
process.stdout.write(chunk.content)
}
if (chunk.toolCalls) {
console.log('AI wants to call tools:', chunk.toolCalls)
}
if (chunk.done) {
console.log('\nResponse complete!')
break
}
}
This package is designed to work alongside other focused packages:
// Example: Complete DeeChat integration
import { AIChat } from '@ai-chat/core'
import { ContextManager } from '@context-manager'
import { MCPClient } from '@mcp-client'
// Each package handles its own responsibility
const aiChat = new AIChat(aiConfig) // AI communication
const contextManager = new ContextManager() // History & state
const mcpClient = new MCPClient() // Tool implementation
// Compose them together
const sessionId = 'session-123'
const history = contextManager.getMessages(sessionId)
const response = await aiChat.sendMessage(
[...history, { role: 'user', content: userInput }],
{
tools: await mcpClient.getTools(),
onToolCall: (call) => mcpClient.executeTools(call)
}
)
// Update context with response
contextManager.addMessage(sessionId, response.message)
npm install @ai-chat/core
# Peer dependencies (install the providers you need)
npm install openai anthropic # for AI providers
We welcome contributions! Please see our Contributing Guide.
MIT License - see LICENSE file for details.
FAQs
Universal AI chat client with intelligent tool calling format adapter - supports OpenAI, Claude, Kimi, and any OpenAI-compatible APIs with robust error handling
The npm package @deepracticex/ai-chat receives a total of 8 weekly downloads. As such, @deepracticex/ai-chat popularity was classified as not popular.
We found that @deepracticex/ai-chat 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
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.