@oflow-ai/core
v0.2.8
Published
Core library for oFlow CLI - AI providers, tools, and utilities
Maintainers
Readme
@oflow-ai/core
Core library for oFlow CLI. Provides AI providers, tools, and utilities.
Installation
npm install @oflow-ai/coreFeatures
- Multi-provider AI support: OpenAI, DeepSeek, Qwen, GLM, Baichuan, Yi, Moonshot, SiliconFlow
- Tool system: File operations, shell commands, web search, and more
- Conversation management: Message history and context handling
- MCP integration: Model Context Protocol server support
- Skill system: Extensible skill packages
- Sub-agents: Specialized agents for different tasks
- Sandbox execution: Docker/Podman isolation
Usage
import { createAIProvider, Conversation, getConfigManager } from '@oflow-ai/core';
// Configure authentication
const configManager = getConfigManager();
configManager.setAuth({
provider: 'deepseek',
apiKey: 'your-api-key',
model: 'deepseek-chat'
});
// Create AI provider
const provider = createAIProvider(configManager.getAuth()!);
// Start conversation
const conversation = new Conversation({
provider,
workingDirectory: process.cwd(),
onContent: (content) => console.log(content)
});
await conversation.sendMessage('Hello!');Supported Providers
| Provider | Auth Type | Models | |----------|-----------|--------| | openai | API Key | gpt-4o, gpt-4-turbo, o1-preview, etc. | | deepseek | API Key | deepseek-chat, deepseek-reasoner | | qwen | API Key | qwen-turbo, qwen-plus, qwen-max | | zhipu | API Key | glm-5, glm-4.7, glm-4.6, glm-4.5 | | baichuan | API Key | Baichuan4, Baichuan3-Turbo | | yi | API Key | yi-lightning, yi-large | | moonshot | API Key | moonshot-v1-8k, moonshot-v1-32k | | siliconflow | API Key | Multiple open-source models | | custom | API Key + Base URL | Any OpenAI-compatible API |
Tools
Available tools:
read_file- Read file contentswrite_file- Write to fileslist_directory- List directory contentsglob- Find files by patternsearch_file_content- Search within filesrun_shell_command- Execute shell commandsweb_search- Search the webweb_fetch- Fetch web contentreplace- Replace text in filesimage_read- Analyze imagespdf_extract- Extract PDF contentask_user_question- Interactive user promptstask- Launch sub-agentssave_memory- Store long-term memories
License
MIT
