GitHub Copilot integration for Microsoft Agent Framework

1.0.0b260409 · active · verified Thu Apr 16

The `agent-framework-github-copilot` library integrates the GitHub Copilot SDK with the Microsoft Agent Framework, providing Python developers with powerful coding-oriented AI capabilities. These capabilities include shell command execution, file operations, URL fetching, and Model Context Protocol (MCP) server integration. It is part of the broader Microsoft Agent Framework, which has unified previously separate AI frameworks like Semantic Kernel and AutoGen. The library is actively developed, with its current version being 1.0.0b260409, and receives regular updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize and run a basic GitHub Copilot Agent. It requires the GitHub Copilot CLI to be installed and authenticated separately. The agent is created with default options and then used to process a simple query.

import asyncio
import os
from agent_framework.github import GitHubCopilotAgent, GitHubCopilotOptions

async def main():
    # Ensure GitHub Copilot CLI is installed and authenticated.
    # For this example, we assume authentication is handled externally or via environment variables.
    # Replace with your actual authentication token or method if needed.
    # os.environ['GITHUB_TOKEN'] = os.environ.get('GITHUB_TOKEN', 'YOUR_GITHUB_TOKEN')
    
    options = GitHubCopilotOptions()
    agent = GitHubCopilotAgent(options)

    print("Asking the GitHub Copilot Agent: What is a Python list comprehension?")
    response = await agent.run_async("What is a Python list comprehension?")
    print(f"Agent Response: {response.output}")

if __name__ == "__main__":
    asyncio.run(main())

view raw JSON →