Example Conversion I Had With Copilot On Vs Code
I have to say that CoPilot is not good at keeping the history. I have tried so hard to actually show my conversation. Each time, I have failed.
This is what I said: copilot: I find that our conversation is very good. I want to share it with my friend and encouage them to use copilot. Please write me a detailed markdown file for all conversation here.
I hope to get one true, not modefied conversation history. No, Copilot tried to summarize and catagorize our conversation.
In the sense, I like what POE.com did. The conversation there could be so easily shared.
one of my example conversion on POE
Example Copilot Chat Session: Building a Chat History System
Session Overview
Date: March 2, 2025
Topic: Implementing chat history functionality with GitHub Copilot
Tools Used: VS Code, GitHub Copilot, Python
Initial Setup
Getting Voyage API
Q: How to get voyage api?
A: Here’s how to obtain and implement the Voyage API:
- Visit Voyage AI’s website
- Sign up process:
- Click “Get Started”
- Create account
- Verify email
- Implementation:
VOYAGE_API_KEY="your_actual_key_here"
from dotenv import load_dotenv
import os
load_dotenv()
voyage_api_key = os.getenv('VOYAGE_API_KEY')
Chat History Implementation
Setting Up the Save Chat Function
Q: How to save our conversations?
A: Created a Python script to handle chat history:
from datetime import datetime
import os
import re
def clean_markdown(text: str) -> str:
"""Clean markdown formatting from text while preserving code blocks."""
return text.replace('```', '````').strip()
def save_chat_history(question: str, answer: str) -> None:
"""Save chat conversation to CHAT_HISTORY.md including code blocks"""
chat_file = os.path.join(os.path.dirname(__file__), "../.github/CHAT_HISTORY.md")
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M")
entry = f"""
## Date: {timestamp}
### Question:
{question}
### Answer:
{clean_markdown(answer)}
---
"""
with open(chat_file, "a", encoding="utf-8") as f:
f.write(entry)
Configuration Setup
Q: How to add Copilot instructions?
A: Created configuration file:
# filepath: /.github/copilot.yml
instructions:
- "Follow these coding standards:"
- "Use clear variable names"
- "Add docstrings"
- "Include type hints"
- "Write unit tests"
- "Save chat history in markdown"
VS Code Integration
Extension Details
Q: What is the latest GitHub Copilot Chat extension?
A: Current information:
- Version: 0.12.2024030713
- Requirements:
- VS Code 1.85.0+
- Active Copilot subscription
- GitHub account access
Running the System
Terminal Commands
# Navigate to tools directory
cd c:\your-project\tools
# Run the chat history script
python save_chat.py
Best Practices
- Store API keys in
.env
files - Use proper markdown formatting
- Implement error handling
- Document code thoroughly
- Follow consistent naming conventions
Code Standards
- Use type hints
- Include docstrings
- Follow PEP 8
- Write unit tests
- Document changes
Resources
Generated with GitHub Copilot - March 2, 2025