multimodal/websites/tarko/docs/en/guide/get-started/quick-start.mdx
Get up and running with Tarko in just a few minutes.
🚧 Work in Progress: The fastest way to get started will be using the Tarko CLI:
npm create tarko # Coming soon
For now, install the core packages manually:
npm install @tarko/agent
Create an agent.ts file based on the real examples:
// From multimodal/tarko/agent/examples/tool-calls/basic.ts
import { Agent, Tool, z, LogLevel } from '@tarko/agent';
const locationTool = new Tool({
id: 'getCurrentLocation',
description: "Get user's current location",
parameters: z.object({}),
function: async () => {
return { location: 'Boston' };
},
});
const weatherTool = new Tool({
id: 'getWeather',
description: 'Get weather information for a specified location',
parameters: z.object({
location: z.string().describe('Location name, such as city name'),
}),
function: async (input) => {
const { location } = input;
return {
location,
temperature: '70°F (21°C)',
condition: 'Sunny',
precipitation: '10%',
humidity: '45%',
wind: '5 mph',
};
},
});
const agent = new Agent({
model: {
provider: 'volcengine',
id: 'doubao-seed-1-6-vision-250815',
apiKey: process.env.ARK_API_KEY,
},
tools: [locationTool, weatherTool],
logLevel: LogLevel.DEBUG,
});
export default agent;
Run your agent directly:
// Run the agent
const response = await agent.run("How's the weather today?");
console.log(response);
For streaming responses:
// From multimodal/tarko/agent/examples/streaming/tool-calls.ts
const response = await agent.run({
input: "How's the weather today?",
stream: true,
});
for await (const chunk of response) {
console.log(chunk);
}
Create a .env file with your API keys:
# .env file
ARK_API_KEY=your-volcengine-api-key
OPENAI_API_KEY=your-openai-api-key
ANTHROPIC_API_KEY=your-anthropic-api-key
Explore working examples in the repository:
multimodal/tarko/agent/examples/tool-calls/basic.ts - Basic tool callsmultimodal/tarko/agent/examples/streaming/tool-calls.ts - Streaming with toolsmultimodal/tarko/agent/examples/model-providers/ - Different model providersTo test the examples work:
# Clone the repository
git clone https://github.com/bytedance/UI-TARS-desktop.git
cd UI-TARS-desktop/multimodal/tarko/agent
# Install dependencies
npm install
# Run basic tool call example
npx tsx examples/tool-calls/basic.ts
# Run streaming example
npx tsx examples/streaming/tool-calls.ts