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.2.1.tar.gz (99.8 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.2.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gh_pydantic_ai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6b5e110d74c262b750cccf8b550dbdefd1bb22d30051ea72cafa3f93a1bb1805
MD5 8c5be5c32a2b08bec97f34d0d45f7cff
BLAKE2b-256 f8684efa0f1331410de30ea4a9245d3b50d29e1964ddf5dec459ff769cdce448

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gh_pydantic_ai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47c06202533486830d80f54e58b2335582c88a6e8bbc9f929e9c5b085d0d84ba
MD5 cef44588650d9ddb4faa8770f3d11151
BLAKE2b-256 55e9943b313b48331230d263c6ba9c0d3ee75c95906457381845f4642e8d3973

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