Open-AutoGLM Implementation in JavaScript
AutoGLM.js is a powerful AI agent framework that can automatically control Android devices through natural language instructions to perform various complex mobile operation tasks.
->TODO List<- Welcome to contribute and provide feedback!
npx @autoglm.js/cliThe model can directly use the
autoglm-phonemodel provided for free by GLM.
- π― Natural Language Control: Control mobile operations through simple text commands
- π± Android Automation: Supports screenshot analysis, app operations, UI interactions, and more
- π§ Intelligent Decision Making: Intelligent task planning and execution based on large language models
- π§ Flexible Configuration: Supports multiple invocation methods and configuration options
- π Multi-language Support: Built-in Chinese and English support
- π¦ Multiple Usage Methods: Provides three usage methods: CLI, API, and desktop application
- Node.js >= 20.0.0
AutoGLM.js provides three usage methods: CLI Command Line Tool, Core API Integration, and Desktop Application [π§ Under Construction].
# Install from npm
npm install -g @autoglm.js/cliCreate ~/.autoglm/config.json file:
{
"$schema": "https://unpkg.com/autoglm.js@latest/schema/agent-config.schema.json",
"maxSteps": 200,
"lang": "cn",
"baseUrl": "https://open.bigmodel.cn/api/paas/v4/",
"apiKey": "your-api-key-here",
"model": "autoglm-phone",
"deviceId": "your-device-id"
}autoglmCLI will launch an interactive interface where you can input natural language commands:
π¬ Please enter task: Open WeChat and send "Hello" to Zhang San
npm install autoglm.jsimport { AutoGLM } from 'autoglm.js'
// Create agent instance
const agent = new AutoGLM({
maxSteps: 200,
lang: 'cn',
baseUrl: 'https://open.bigmodel.cn/api/paas/v4/',
apiKey: 'your-api-key-here',
model: 'autoglm-phone',
deviceId: 'your-device-id'
})
// Execute task
agent.run('Open WeChat and send "Hello" to Zhang San')import { AutoGLM, EventType } from 'autoglm.js'
const agent = new AutoGLM({
baseUrl: 'https://open.bigmodel.cn/api/paas/v4/',
apiKey: 'your-api-key-here',
model: 'autoglm-phone',
})
// Listen to all events
agent.on('*', (type, data) => {
console.log(`[${type}]`, data)
})
// Listen to specific events
agent.on(EventType.Thinking, (data) => {
console.log('Thinking:', data)
})
agent.on(EventType.TaskComplete, (result) => {
console.log('Task completed:', result)
})
// Execute task
agent.run('Open Douyin')The desktop application is under development and will provide a graphical interface to use all features of AutoGLM.js. Welcome to contribute and provide feedback.
| Parameter | Type | Default | Description |
|---|---|---|---|
maxSteps |
number | 100 | Maximum number of execution steps |
lang |
string | 'cn' | Language setting ('cn' or 'en') |
deviceId |
string | - | Android device ID |
systemPrompt |
string | - | Custom system prompt |
screenshotQuality |
number | 80 | Screenshot quality (1-100) |
| Parameter | Type | Default | Description |
|---|---|---|---|
baseUrl |
string | 'http://localhost:8000/v1' | API base URL |
apiKey |
string | - | API key |
model |
string | 'autoglm-phone' | Model name |
maxTokens |
number | 3000 | Maximum token count |
temperature |
number | 0.0 | Temperature parameter |
topP |
number | 0.85 | Top P parameter |
frequencyPenalty |
number | 0.2 | Frequency penalty parameter |
This project is open source under the MIT License.
- Open-AutoGLM - Original project inspiration
- π¬ Submit Issue
- π§ Email: flippedround@qq.com
- π Sponsor Project
ππ»ββοΈSponsors
If this project helps you, please give it a βοΈ to support!
Made with β€οΈ by @FliPPeDround
