Core API
These signatures describe @providerkit/core 0.36.7. Start with the quickstart for a working provider call.
| Import path | Exports |
|---|---|
@providerkit/core |
Providers, messages, tools, errors and stream helpers |
@providerkit/core/hosted |
Providers and registries with hosted tools enabled |
@providerkit/core/otel |
withProviderTracing |
@providerkit/core/zod |
Zod tool helpers |
@providerkit/core/decisions |
Decision models |
@providerkit/core/embeddings |
Turn text into vectors for search |
@providerkit/core/images |
Generate images without a chat |
@providerkit/core/video |
Read a video with Gemini |
@providerkit/core/speech |
Speech synthesis |
@providerkit/core/transcription |
Audio transcription |
@providerkit/core/auth |
Sign-in and token refresh |
The Core API sidebar lists the generated symbols under each entry. Optional entries may need a peer package; the main entry does not load them.
Hosted tools
Section titled “Hosted tools”/hosted supplies provider and registry factories that opt into vendor-run work, such as web
search or image generation. The plain chat factories do not load its encoders or parsers. Use the
hosted-tools guide to configure a provider call. These results do
not become local tool calls for your app to execute.
OpenTelemetry tracing
Section titled “OpenTelemetry tracing”/otel exports withProviderTracing. Wrap a provider with an OpenTelemetry tracer to record chat
spans. It requires the optional @opentelemetry/api peer. It does not install an exporter or send
traces by itself.
Prompts, output, reasoning and tool arguments are excluded. See ProviderTracingOptions for the fields and content policy. Your app owns the tracer, exporter and retention.
Tool result metadata
Section titled “Tool result metadata”Tool.outputSchema is optional JSON Schema metadata for a tool’s result. Core keeps it on the
tool instance, not in the provider’s tool definition. It does not validate results with it.
Validate your runtime output where your app needs that guarantee.