Skip to content

Instantly share code, notes, and snippets.

View andreas-kater's full-sized avatar
🎯
Focusing

Andreas Kater andreas-kater

🎯
Focusing
View GitHub Profile
@andreas-kater
andreas-kater / index.js
Created September 11, 2025 14:12
Recursive ChatGPT function calling
import OpenAI from 'openai';
import 'dotenv/config';
//Instructions to run:
// 1. npm install openai dotenv
// 2. create .env file with OPENAI_API_KEY=yourkey
// 3. node index.js
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });