myfirstpypiproject-quickchat 0.1.0
A simple command-line chat tool for interactive conversations with LLMs
Requires Python: >=3.12

# QuickChat

A simple command-line chat tool for interactive conversations with Large Language Models (LLMs) powered by OpenAI.

## Features

- 🚀 Simple command-line interface
- 💬 Interactive chat with conversation history
- 🔄 Maintains context across messages
- ⚡ Fast responses using OpenAI's GPT models
- 🛡️ Built-in error handling and rate limiting
- 🎯 Easy to use with simple commands

## Installation

### From PyPI (Recommended)

```bash
pip install myfirstpypiproject-quickchat
```

### From Source

```bash
git clone <repository-url>
cd MyFirstPypiProject_QuickChat
pip install -e .
```

## Setup

1. **Get an OpenAI API Key**
   - Visit [OpenAI Platform](https://platform.openai.com/api-keys)
   - Create a new API key
   - Copy the key

2. **Set Environment Variable**

   **Windows:**
   ```cmd
   set OPENAI_API_KEY=your_api_key_here
   ```

   **Linux/Mac:**
   ```bash
   export OPENAI_API_KEY=your_api_key_here
   ```

   **For permanent setup, add to your shell profile:**
   - Windows: Add to System Environment Variables
   - Linux/Mac: Add to `~/.bashrc`, `~/.zshrc`, or `~/.profile`

## Usage

After installation, simply run:

```bash
chat
```

### Available Commands

- **Type your message**: Send any message to chat with the LLM
- **`quit`**, **`exit`**, or **`bye`**: End the conversation
- **`clear`**: Clear conversation history
- **`help`**: Show available commands

### Example Session

```
🤖 QuickChat - Interactive LLM Chat Tool
==================================================
Type 'quit', 'exit', or 'bye' to end the conversation
Type 'clear' to clear conversation history
Type 'help' for available commands
==================================================

💬 You: Hello! How are you today?
🤔 Thinking...

🤖 Assistant: Hello! I'm doing well, thank you for asking! I'm here and ready to help you with any questions or tasks you might have. How can I assist you today?

💬 You: Can you help me write a Python function?
🤔 Thinking...

🤖 Assistant: Absolutely! I'd be happy to help you write a Python function. What kind of function would you like to create? Please let me know:
- What the function should do
- What parameters it should take
- What it should return
- Any specific requirements or constraints

💬 You: quit

👋 Goodbye! Thanks for chatting!
```

## Requirements

- Python 3.12 or higher
- OpenAI API key
- Internet connection

## Dependencies

- `openai>=1.102.0` - OpenAI Python client
- `requests>=2.32.5` - HTTP library

## Configuration

The tool uses OpenAI's `gpt-3.5-turbo` model by default. You can modify the model and parameters in the source code:

- **Model**: Change `model="gpt-3.5-turbo"` in `main.py`
- **Max Tokens**: Adjust `max_tokens=1000`
- **Temperature**: Modify `temperature=0.7`

## Troubleshooting

### Common Issues

1. **"OPENAI_API_KEY environment variable not set"**
   - Ensure you've set the environment variable correctly
   - Restart your terminal after setting the variable

2. **"Rate limit exceeded"**
   - Wait a moment before sending another message
   - Check your OpenAI account usage limits

3. **"API error occurred"**
   - Verify your API key is correct
   - Check your OpenAI account status and billing

### Getting Help

If you encounter issues:
1. Check that your OpenAI API key is valid
2. Ensure you have sufficient API credits
3. Verify your internet connection
4. Check the error messages for specific details

## Development

To contribute to this project:

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

## License

This project is open source and available under the [MIT License](LICENSE).

## Support

For support, please open an issue on the project repository or contact the maintainers.

---

**Happy Chatting! 🤖💬**