Agent Demo Web App (Comedy Duo & Number Guessing)
------------------------------------------------

This project shows off two simple agent demos powered by the OpenAI API:
1. Comedy Duo: Two comedians (Joe & Cathy) riff back and forth, or deliver one-liners.
2. Number Guessing: Three modes (AI vs AI, You guess, AI guesses).

Requirements
------------
- Node.js v18 or newer (https://nodejs.org/)
- An OpenAI API key (https://platform.openai.com/)

Setup Instructions
------------------
1. Open a terminal and navigate to this project directory.

2. Install the needed dependencies:
   npm install express openai cors dotenv

3. Create a file named ".env" in the project root with the following line:
   OPENAI_API_KEY=sk-your-own-key-here

   (Replace 'sk-your-own-key-here' with your actual key from OpenAI.)

4. Start the server:
   node server.js

5. Open your browser and go to:
   http://localhost:8787

Usage
-----
- Comedy Duo:
  * "Start Duo" → Joe and Cathy alternate for N rounds on your chosen theme.
  * "Ask for one-liner" → Pick Joe or Cathy, type a prompt, and receive one witty line.

- Number Guessing:
  * AI vs AI → Narrator reveals guesses step-by-step.
  * You guess → Server picks a number; you try to guess it.
  * AI guesses → You provide feedback (too low/high/correct) and AI narrows down.

Notes
-----
- The UI lives in public/index.html. No build step required.
- Errors will be shown inline in the UI.
- Default model is gpt-4o-mini for speed/cost. Switch to gpt-4o in server.js if desired.

Troubleshooting
---------------
- If nothing happens when you click buttons, check your browser console and the terminal for errors.
- Ensure your .env file exists and contains a valid OPENAI_API_KEY.
- If port 8787 is in use, edit server.js to change the port.
