GitHub Copilot Chat: A Conversational & Agentic AI Experience
The Three Modes of Interaction
When you open the chat panel, you have three modes of interaction:
- Ask
- Edit
- Agent
Based on what you want to achieve, you can choose the appropriate mode by selecting it from the dropdown menu in the prompt box.
The Ask Mode
Historically, this was the first mode available when GitHub Copilot Chat was in its early stages. It's a simple chat interface where you can ask questions and get answers. To add context, you can highlight code snippets in the editor before asking your question.
For example, if you highlight the second code block below and ask, "Can you explain this code?" or "Are there any other exceptions I should handle?", Copilot will provide an explanation of the selected code snippet and not the whole file, even if it could take some context from it.
import http.server
import socketserver
PORT = 8000
class SimpleHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
# Logs the request's path to the console
print(f"GET request for {self.path}")
# Call the superclass method to actually serve the request
super().do_GET()
# Set up the HTTP server
with socketserver.TCPServer(("", PORT), SimpleHTTPRequestHandler) as httpd:
print("Serving at port", PORT)
try:Building with GitHub Copilot
From Autocomplete to Autonomous AgentsEnroll now to unlock all content and receive all future updates for free.
