Skip to content

Tarak-Chandra-Sarkar/GitHubCopilotSDKExample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌀️ 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 ⭐

About

Async Python terminal chatbot with Rich UI, tool calling, and LLM-powered weather responses using GitHub Copilot SDK

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages