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.0.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.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gh_pydantic_ai-0.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 7e10f347fcbcb9cc28917be7de02084f2522933390d1026f961b8839d536bedf
MD5 7136b51486541fc3193f4bc7591b64aa
BLAKE2b-256 43c0c75bdf814cff1afd7c84f776aa4a762c7b55bc01cdb4b9f05413e46285c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gh_pydantic_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 306e1bcf64b8cb41bb66207c43ff2870f3734fe1e403a2e7510942f8e1e54973
MD5 35b206e8d8b4e00406c2a555dfebe934
BLAKE2b-256 fe87c06cf9520ed615876d5992959c629fcd7b2834add82cad1d0463cdf03489

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