File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * Example runner
3+ *
4+ * Usage:
5+ * npx tsx examples/index.ts # runs simple-agent
6+ * npx tsx examples/index.ts simple # runs simple-agent
7+ * npx tsx examples/index.ts multi-turn # runs multi-turn-chat
8+ * npm run dev # runs simple-agent with nodemon
9+ */
10+
11+ const example = process . argv [ 2 ] || "simple" ;
12+
13+ const examples : Record < string , string > = {
14+ simple : "./simple-agent.ts" ,
15+ "multi-turn" : "./multi-turn-chat.ts"
16+ } ;
17+
18+ const file = examples [ example ] ;
19+ if ( ! file ) {
20+ console . error ( `Unknown example: "${ example } "` ) ;
21+ console . error ( `Available: ${ Object . keys ( examples ) . join ( ", " ) } ` ) ;
22+ process . exit ( 1 ) ;
23+ }
24+
25+ await import ( file ) ;
Original file line number Diff line number Diff line change 2424 "test:unit" : " vitest --run unit" ,
2525 "test:integration" : " vitest --run integration" ,
2626 "ci:unit" : " vitest --watch unit" ,
27- "dev" : " nodemon --inspect examples/simple-agent .ts" ,
27+ "dev" : " nodemon --inspect examples/index .ts" ,
2828 "prepack" : " npm run build"
2929 },
3030 "keywords" : [
You can’t perform that action at this time.
0 commit comments