AI Settings

API Key

Web Search (EXA)

Supabase Vector Store

Environment Variables

Add these to your .env.local file:

OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GROQ_API_KEY=your_groq_api_key
GOOGLE_API_KEY=your_google_api_key
DEEPSEEK_API_KEY=your_deepseek_api_key
FIREWORKS_API_KEY=your_fireworks_api_key

Current Selection

Provider: OpenAI
Model: GPT-4o Mini
Max Tokens: 16,384
Context Window: 16,384
β–² + πŸ¦œπŸ”—
  • 🧱 This template showcases how to output structured responses with a LangChain.js chain and the Vercel AI SDK in a Next.js project.
  • ☎️ The chain formats the input schema and passes it into an OpenAI Functions model, then parses the output.
  • πŸ’» You can find the prompt, model, and schema logic for this use-case in app/api/chat/structured_output/route.ts.
  • πŸ“Š By default, the chain returns an object with tone, word_count, entity, chat_response, and an optional final_punctuation, but you can change it to whatever you'd like!
  • πŸ’Ž It uses a lightweight, convenient, and powerful schema validation library called Zod to define schemas, but you can initialize the chain with JSON schema too.
  • 🎨 The main frontend logic is found in app/structured_output/page.tsx.
  • πŸ‘‡ Try typing e.g. What a beautiful day! below!