|
69 | 69 | "source": [ |
70 | 70 | "## Making your first agent using LangGraph\n", |
71 | 71 | "\n", |
72 | | - "Create a file named `agent.ts` (short for Reason + Act Agent) and add the below TypeScript code to it.\n", |
| 72 | + "Create a file named `agent.mts` (short for Reason + Act Agent) and add the below TypeScript code to it.\n", |
73 | 73 | "\n", |
74 | 74 | "Make sure you update the environment variables at the top of the file to contain your API keys. If you don't, the OpenAI and Tavily API calls will produce errors and your agent will not work correctly.\n", |
75 | 75 | "\n", |
76 | 76 | "Once you've added your API keys, save the file and run the code with the following command:\n", |
77 | 77 | "\n", |
78 | 78 | "```bash\n", |
79 | | - "npx tsx agent.ts\n", |
| 79 | + "npx tsx agent.mts\n", |
80 | 80 | "```" |
81 | 81 | ] |
82 | 82 | }, |
|
114 | 114 | } |
115 | 115 | ], |
116 | 116 | "source": [ |
117 | | - "// agent.ts\n", |
| 117 | + "// agent.mts\n", |
118 | 118 | "\n", |
119 | 119 | "// IMPORTANT - Add your API keys here. Be careful not to publish them.\n", |
120 | 120 | "process.env.OPENAI_API_KEY = \"sk-...\";\n", |
|
224 | 224 | "code creates an agent with the same behavior as the example above, but you can\n", |
225 | 225 | "clearly see the execution logic and how you could customize it.\n", |
226 | 226 | "\n", |
227 | | - "Update the code in your `agent.ts` file to match the example below. Once again, be sure to update\n", |
| 227 | + "Update the code in your `agent.mts` file to match the example below. Once again, be sure to update\n", |
228 | 228 | "the environment variables at the top.\n", |
229 | 229 | "\n", |
230 | 230 | "After you've updated your environment variables and saved the file, you can run it with the same command as before:\n", |
231 | 231 | "\n", |
232 | 232 | "```bash\n", |
233 | | - "npx tsx agent.ts\n", |
| 233 | + "npx tsx agent.mts\n", |
234 | 234 | "```" |
235 | 235 | ] |
236 | 236 | }, |
|
240 | 240 | "metadata": {}, |
241 | 241 | "outputs": [], |
242 | 242 | "source": [ |
243 | | - "// agent.ts\n", |
| 243 | + "// agent.mts\n", |
244 | 244 | "\n", |
245 | 245 | "// IMPORTANT - Add your API keys here. Be careful not to publish them.\n", |
246 | 246 | "process.env.OPENAI_API_KEY = \"sk-...\";\n", |
|
0 commit comments