@@ -38,7 +38,7 @@ npm install @tarko/agent
3838Create a ` index.ts ` :
3939
4040``` ts
41- import { Agent , Tool , z } from ' @tarko/agent' ;
41+ import { Agent , Tool , z , LogLevel } from ' @tarko/agent' ;
4242
4343const locationTool = new Tool ({
4444 id: ' getCurrentLocation' ,
@@ -69,6 +69,11 @@ const weatherTool = new Tool({
6969});
7070
7171const agent = new Agent ({
72+ model: {
73+ provider: ' openai' ,
74+ id: ' gpt-4o' ,
75+ apiKey: process .env .OPENAI_API_KEY ,
76+ },
7277 tools: [locationTool , weatherTool ],
7378});
7479
@@ -115,11 +120,16 @@ const agent = new Agent({
115120
116121#### Agent Options
117122
123+ Based on the actual ` AgentOptions ` interface from the source code:
124+
118125- ` tools ` : Array of tools available to the agent
119- - ` systemPrompt ` : System prompt for the agent
120- - ` modelProvider ` : Configuration for the LLM provider
121- - ` stream ` : Enable streaming responses (default: false)
122- - ` maxIterations ` : Maximum number of iterations (default: 10)
126+ - ` instructions ` : System prompt for the agent (not ` systemPrompt ` )
127+ - ` model ` : Model configuration (not ` modelProvider ` )
128+ - ` maxIterations ` : Maximum number of iterations (default: 1000, not 10)
129+ - ` temperature ` : LLM temperature (default: 0.7)
130+ - ` maxTokens ` : Token limit per request (default: 1000)
131+ - ` toolCallEngine ` : Tool call engine type ('native' | 'prompt_engineering' | 'structured_outputs')
132+ - ` logLevel ` : Log level for debugging
123133
124134### Tool
125135
@@ -246,16 +256,17 @@ try {
246256``` ts
247257const agent = new Agent ({
248258 tools: [weatherTool , locationTool ],
249- systemPrompt: ' You are a helpful weather assistant.' ,
250- modelProvider: {
259+ instructions: ' You are a helpful weather assistant.' ,
260+ model: {
261+ provider: ' openai' ,
262+ id: ' gpt-4o' ,
251263 apiKey: process .env .OPENAI_API_KEY ,
252- baseURL: ' https://api.openai.com/v1' ,
253- model: ' gpt-4' ,
254- temperature: 0.7 ,
255- maxTokens: 1000 ,
256264 },
257- maxIterations: 5 ,
258- stream: true ,
265+ temperature: 0.7 ,
266+ maxTokens: 1000 ,
267+ maxIterations: 20 ,
268+ toolCallEngine: ' native' ,
269+ logLevel: LogLevel .DEBUG ,
259270});
260271```
261272
0 commit comments