|
| 1 | +/* |
| 2 | + * Copyright (c) 2025 Bytedance, Inc. and its affiliates. |
| 3 | + * SPDX-License-Identifier: Apache-2.0 |
| 4 | + */ |
| 5 | + |
| 6 | +import { AgentTARS, AgentTARSOptions } from '../src'; |
| 7 | + |
| 8 | +export default class MyAIOAgentTARS< |
| 9 | + T extends AgentTARSOptions = AgentTARSOptions, |
| 10 | +> extends AgentTARS<T> { |
| 11 | + static label = 'AIOAgentTARS'; |
| 12 | +} |
| 13 | + |
| 14 | +async function main() { |
| 15 | + const aioAgent = new AgentTARS({ |
| 16 | + aioSandbox: 'http://localhost:8080', |
| 17 | + model: { |
| 18 | + provider: 'volcengine', |
| 19 | + id: 'ep-20250510145437-5sxhs', |
| 20 | + apiKey: process.env.ARK_API_KEY, |
| 21 | + displayName: 'doubao-1.5-thinking-vision-pro', |
| 22 | + }, |
| 23 | + }); |
| 24 | + |
| 25 | + await aioAgent.initialize(); |
| 26 | + |
| 27 | + const tools = aioAgent.getTools(); |
| 28 | + console.log('\n📋 Available Tools:'); |
| 29 | + console.log('─'.repeat(80)); |
| 30 | + tools.forEach((tool, index) => { |
| 31 | + const num = (index + 1).toString().padStart(2, ' '); |
| 32 | + const name = tool.name.padEnd(30, ' '); |
| 33 | + const desc = (tool.description || 'No description').substring(0, 45).replace(/\n/g, ' '); |
| 34 | + console.log(`${num}. ${name} │ ${desc}`); |
| 35 | + }); |
| 36 | + console.log('─'.repeat(80)); |
| 37 | + console.log(`Total: ${tools.length} tools\n`); |
| 38 | + |
| 39 | + const response = await aioAgent.run('Open https://seed-tars.com'); |
| 40 | + console.log(response); |
| 41 | +} |
| 42 | + |
| 43 | +main(); |
0 commit comments