Skip to main content

GitHub Copilot Provider for Pydantic AI

Project description

gh-copilot-pydantic-ai

License: MIT PyPI version Python Version

GitHub Copilot Provider for Pydantic AI.

Inspired by ericc-ch/copilot-api/.

Installation

Install the package using pipx or your favorite package manager:

pip install gh-pydantic-ai
# or with uv
uv tool install gh-pydantic-ai

CLI Usage

Authentication

First, you need to authenticate with your GitHub account.

gh-clai-internal auth

Query

After authentication, you can use the gh-clai command to interact with GitHub Copilot:

gh-clai "What is the capital of France?"

Library Usage

This library also provides GHCopilotModel for integration with Pydantic AI.

from gh_pydantic_ai import GHCopilotModel
from pydantic_ai import Agent

agent = Agent(
    model=GHCopilotModel()
)

result = agent.run_sync("What is the capital of France?")
print(result)

Commands

  • gh-clai: Main command to interact with GitHub Copilot, works same as clai command from pydantic-ai.
  • gh-clai-internal: Internal commands for authentication and other utilities.
    • auth: Authenticate with GitHub.
    • models: List available models.
    • usage: Show usage information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gh_pydantic_ai-0.1.2.tar.gz (66.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gh_pydantic_ai-0.1.2-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file gh_pydantic_ai-0.1.2.tar.gz.

File metadata

  • Download URL: gh_pydantic_ai-0.1.2.tar.gz
  • Upload date:
  • Size: 66.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.2

File hashes

Hashes for gh_pydantic_ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e70ef00db36eb51a7be78b7b82f0353f294229137522e9abca339e95969c3fc9
MD5 4089de1bec7b0c5261fbcaee58361c66
BLAKE2b-256 7ae67e7cdba98b6a183fdcd62a891fd5926e5768c3af5ef588a3a77de9be3fac

See more details on using hashes here.

File details

Details for the file gh_pydantic_ai-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for gh_pydantic_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e2c76ae6107326e54837bb50e9def63e3a3d3ac169dced564d752ea9fab59364
MD5 505e7a4afbf774454592187adf3f700f
BLAKE2b-256 5784128eee74c75103f78fdb46e4987ef1f239a8aae3eab5936273df44b80626

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page