from openai import OpenAI
# Initialize client pointing to local BLAST server
client = OpenAI(
api_key="not-needed",
base_url="http://127.0.0.1:8000"
)
# Create a streaming response
stream = client.responses.create(
model="not-needed",
input="Compare the r/protectandserve and r/securityguard subreddits",
stream=True
)
# Process the stream
for event in stream:
if event.type == "response.output_text.delta":
# Print real-time thoughts/actions
if ' ' in event.delta: # Skip screenshots
print(event.delta, end='', flush=True)