A Python wrapper for GitHub Copilot API that allows you to use Copilot's chat capabilities in your applications.
- Simple authentication flow with GitHub device code
- Secure token storage with basic encryption
- Automatic token refresh when expired
- Support for different Copilot models (gpt-4o-mini, etc.)
- Streaming responses for real-time interactions
- Easy-to-use Python interface
Here's a basic example of how to use the SQLAlchemy Router:
from CopilotAI import CopilotClient
ai = CopilotClient('app')
model = 'gpt-4o-mini'
messages = [{"role": "user", "content": "Hello, how are you?"}]
result = ai.create_chat(model, messages)
print(result)
# result: Hello! I'm just a program, so I don't have feelings, but I'm here and ready to help you. How can I assist you today?