A Val Town template for building AI agents using the OpenAI Agents SDK.
Want model flexibility? Check out the Vercel AI SDK Agent template — same agent pattern, but you can swap in Anthropic, Google, or any other provider by changing one line.
An agent is inference in a loop with tools: an LLM receives a system prompt, reads from and writes to an environment through tools, and loops until it decides it's done.
Rendering mermaid diagram...
OPENAI_API_KEY environment variable. Get your OpenAI API key
here: https://platform.openai.com/api-keysmain.ts. You can
provide custom instructions, choose a different model, or add custom tools.Run on main.ts