1.1 KiB
1.1 KiB
Simple PocketFlow Chat
A basic chat application using PocketFlow with OpenAI's GPT-4o model.
Features
- Conversational chat interface in the terminal
- Maintains full conversation history for context
- Simple implementation demonstrating PocketFlow's node and flow concepts
Run It
-
Make sure your OpenAI API key is set:
export OPENAI_API_KEY="your-api-key-here"Alternatively, you can edit the
utils.pyfile to include your API key directly. -
Install requirements and run the application:
pip install -r requirements.txt python main.py
How It Works
flowchart LR
chat[ChatNode] -->|continue| chat
The chat application uses:
- A single
ChatNodewith a self-loop that:- Takes user input in the
prepmethod - Sends the complete conversation history to GPT-4o
- Adds responses to the conversation history
- Loops back to continue the chat until the user types 'exit'
- Takes user input in the