Skip to content

Latest commit

 

History

History
243 lines (153 loc) · 4.43 KB

File metadata and controls

243 lines (153 loc) · 4.43 KB

🌤️ Weather Assistant (Terminal Chat UI) powered by GitHub Copilot SDK with LLM Model

Project Repo Structure:

GitHubCopilotSDKExample/
│
├── interactive_assistant.py
├── README.md
├── requirements.txt
├── .gitignore
│
├── assets/
│   ├── image1.png
│   └── image2.png
│
└── LICENSE

🚀 Overview

A ChatGPT-style terminal assistant built using:

  • 🎨 Rich terminal UI
  • ⚡ Async Python
  • 🤖 LLM-powered responses
  • 🔧 Tool calling (weather simulation)

🏷️ Badges

Python Async UI License


✨ Features

  • 💬 Chat-style terminal interface (user & assistant bubbles)
  • 🎨 Beautiful UI using Rich
  • 📊 Markdown rendering (tables, lists, summaries)
  • ⚡ Async streaming responses
  • 🔧 Tool calling (weather simulation)
  • 🔁 Continuous conversation loop

📸 Screenshots

🟡 Chat Interface


🔵 Weather Comparison Output


🛠️ Tech Stack

  • :contentReference[oaicite:0]{index=0}
  • Asyncio
  • CopilotClient SDK
  • Pydantic

📋 Prerequisites: Setting Up Your Environment

Before writing any code, make sure your development environment meets the following requirements.


✅ Prerequisites Checklist

1. Install the GitHub Copilot CLI

The GitHub Copilot CLI does not itself perform AI inference. Instead, it communicates with the Copilot backend via JSON-RPC.

In this architecture, the CLI acts as the engine, while your SDK/application acts as the interface layer (steering wheel).


🛠 Installation (Windows/Linux)

winget install copilot-cli # Windows
brew install copilot-cli # Mac/Linux

🔍 Verify Installation

copilot --version

2. Authenticate Your GitHub Account

Sign in using your GitHub account:

copilot login

⚠️ You must have an active GitHub Copilot subscription (individual or enterprise).

If you are using BYOK (Bring Your Own Key) mode, authentication can be skipped.


🔎 Verify the Environment

Run the following command to ensure everything is working correctly:

copilot -p "Explain recursion in one sentence"

🎯 Expected Result

If the setup is correct, you should see an AI-generated response in the terminal.

  • ✔ If you receive a response → environment is ready
  • ❌ If not → recheck installation or authentication steps

📦 Installation

git clone https://github.com/Tarak-Chandra-Sarkar/GitHubCopilotSDKExample
cd GitHubCopilotSDKExample

Create virtual environment

python -m venv venv
source venv/bin/activate     # Mac/Linux
venv\Scripts\activate        # Windows

Install dependencies

pip install -r requirements.txt

▶️ Usage

python interactive_assistant.py

💡 Example Prompts

  • What's the weather in Mumbai?
  • Compare weather in Kolkata and Chennai
  • Is it raining in Delhi?

⚙️ Configuration

You can change the model:

model="gpt-4o"

🧠 How It Works

🔧 Tool System

  • Model calls get_weather(city)
  • Returns structured JSON
  • Used in response generation

⚡ Event Streaming

  • assistant.message_delta → builds response
  • session.idle → marks completion

🎨 UI Rendering

  • Panel → chat bubbles
  • Markdown → formatted outputs

🚀 Future Improvements

  • 🌐 Real weather API integration
  • 🧠 Memory-based conversations
  • ⚡ Streaming inside bubbles (typing effect)
  • 🖥️ Full TUI (scrollable chat history)
  • 🌍 Web version (FastAPI + React)

🤝 Contributing

PRs welcome! Feel free to improve UI, tools, or architecture.


📄 License

MIT License


⭐ Support

If you like this project, consider giving it a star ⭐