What ai does today. Every capability below is backed by the shipped Copilot provider and the typed core.
Model calls
Async EventStream with a typed event union and a .result() future for the final message.
Tool definitions plus per-model supports_tool_calls and supports_parallel_tool_calls capability flags.
A built-in provider.web_search() and a StreamOptions.web_search flag that enables in-turn browsing where the model supports it.
StreamOptions carries a ThinkingLevel so reasoning depth is a first-class request parameter.
A StreamOptions.cancel asyncio.Event aborts an in-flight stream cooperatively.
provider.embed() with EmbeddingRequest / EmbeddingResponse types for vector workloads.
Accounting
Usage, CostBreakdown, and ModelCost accompany every response; Copilot premium-request multipliers are modelled.
sync_models fetches the live /models list, caches it (24h TTL) with a bundled fallback set so the picker still works offline.
SystemPromptBlock(cache=True) marks the static prompt base cacheable across turns.
Providers
Copilot auth uses the GitHub device-code flow, exchanging for a Copilot JWT — no API key to paste.
Copilot models are reached over openai-completions, anthropic-messages, or openai-responses, chosen per model.
Interop
proxy.py serves /v1/messages so Anthropic-SDK clients can target the same backend unchanged.