#!/usr/bin/env python3
from openai import OpenAI
from dotenv import load_dotenv

load_dotenv()
client = OpenAI()

stream = client.responses.create(
  model = "gpt-5-mini",
  input = "How do I use list comprehension in Python?",
  stream = True
)

for event in stream:
    if event.type == "response.output_text.delta":
        print(event.delta, end='', flush=True)
