Skip to content

Implement Dobby - Personal AI Assistant with OpenAI Integration#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/ai-for-dobby
Draft

Implement Dobby - Personal AI Assistant with OpenAI Integration#1
Copilot wants to merge 2 commits intomainfrom
copilot/ai-for-dobby

Conversation

Copy link

Copilot AI commented Oct 13, 2025

Overview

This PR implements Dobby, a friendly and helpful personal AI assistant powered by OpenAI's GPT models. Named after the loyal house-elf from Harry Potter, Dobby is always eager to help users with questions, tasks, and conversations.

What's Implemented

Core Functionality (dobby.py)

  • Dobby AI Assistant Class: Full-featured implementation with:
    • Chat interface using OpenAI's GPT-3.5-turbo
    • Conversation history management
    • Easy conversation reset
    • Comprehensive error handling
  • Interactive CLI Mode: User-friendly command-line interface with welcome message, commands (quit, exit, reset), and clear instructions
  • Dual Usage: Works both as a standalone CLI tool and as an importable Python module

Testing (test_dobby.py)

  • 7 comprehensive unit tests covering all major functionality
  • Tests for initialization (with/without API key), chat operations, conversation history, and error handling
  • All tests passing ✅

Documentation & Examples

  • README.md: Complete documentation with:
    • Installation instructions
    • Usage examples (both interactive and programmatic)
    • Feature list and configuration guide
    • Project structure overview
  • example_usage.py: Three detailed examples demonstrating programmatic usage
  • .env.example: Template for secure API key configuration

Project Setup

  • requirements.txt: Minimal dependencies (openai, python-dotenv)
  • .gitignore: Proper exclusions for Python projects (cache, virtual environments, IDE files)

Usage

Interactive Mode

python dobby.py

As a Python Module

from dobby import Dobby

dobby = Dobby()
response = dobby.chat("Hello! Can you help me with Python?")
print(response)

Setup Required

Users need to:

  1. Install dependencies: pip install -r requirements.txt
  2. Get an OpenAI API key from https://platform.openai.com/api-keys
  3. Create a .env file with their API key (template provided in .env.example)

Key Features

  • 💬 Interactive chat interface with GPT-3.5-turbo
  • 🧠 Maintains conversation context within sessions
  • 🔄 Easy conversation reset functionality
  • 🎯 Simple and intuitive command-line interface
  • 📦 Can be used as both CLI tool and Python library
  • ✅ Full test coverage with unit tests
  • 📖 Comprehensive documentation and examples

The implementation is minimal, focused, and production-ready!

Original prompt

AI for me - Dobby


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: getmanele <25000832+getmanele@users.noreply.github.com>
Copilot AI changed the title [WIP] Add AI functionality for Dobby Implement Dobby - Personal AI Assistant with OpenAI Integration Oct 13, 2025
Copilot AI requested a review from getmanele October 13, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants