Documentation
¶
Index ¶
- Variables
- type APIStatusError
- type Model
- func (s *Model) CountTokens(ctx context.Context, req tacklr.ModelRequest) (int, error)
- func (s *Model) Invoke(ctx context.Context, req tacklr.ModelRequest) (chan tacklr.LLMResponseChunk, error)
- func (s *Model) MaxContextWindow() (int, error)
- func (s *Model) ModelTelemetryIdentity() telemetry.ModelIdentity
- func (s *Model) SupportsMIME(mimeType string) bool
- func (s *Model) WithApiKey(key string) *Model
- func (s *Model) WithModel(model string) *Model
- func (s *Model) WithReasoningLevel(level string) *Model
- func (s *Model) WithReasoningSummary(summary string) *Model
- func (s *Model) WithURL(url string) *Model
Constants ¶
This section is empty.
Variables ¶
var ( // ErrIncompleteStream is a stream that closed before its terminal event. ErrIncompleteStream = provider.ErrIncompleteStream // ErrMalformedStream is a stream event that is not valid JSON. ErrMalformedStream = provider.ErrMalformedStream )
Functions ¶
This section is empty.
Types ¶
type APIStatusError ¶
type APIStatusError = provider.APIStatusError
APIStatusError is an HTTP error answer from the provider. Find it in a wrapped chain with errors.As.
type Model ¶ added in v0.5.0
type Model struct {
// contains filtered or unexported fields
}
Model holds only model and endpoint settings; each request carries its own prompt and cache key, so one is safe to share.
func New ¶ added in v0.5.0
New is a model client over client, whose requests carry their trace context (W3C traceparent), so a gateway before the provider continues the turn's trace. A nil client is http.DefaultClient's settings.
func NewOpenRouter ¶ added in v0.5.0
NewOpenRouter returns an OpenAI Responses strategy preconfigured for OpenRouter.
OpenRouter validates prompt_cache_options.mode and rejects "implicit", so the strategy pins a key-only cache profile: prompt_cache_key is sent, while the GPT-5.6 cache options and content-block breakpoints stay off the wire.
func (*Model) CountTokens ¶ added in v0.5.0
func (*Model) Invoke ¶ added in v0.5.0
func (s *Model) Invoke(ctx context.Context, req tacklr.ModelRequest) (chan tacklr.LLMResponseChunk, error)
func (*Model) MaxContextWindow ¶ added in v0.5.0
func (*Model) ModelTelemetryIdentity ¶ added in v0.5.0
func (s *Model) ModelTelemetryIdentity() telemetry.ModelIdentity
ModelTelemetryIdentity names the provider and model for model spans.
func (*Model) SupportsMIME ¶ added in v0.5.0
SupportsMIME implements tacklr.Model for the selected model id.
func (*Model) WithApiKey ¶ added in v0.5.0
func (*Model) WithReasoningLevel ¶ added in v0.5.0
func (*Model) WithReasoningSummary ¶ added in v0.5.0
WithReasoningSummary sets reasoning.summary on Responses API requests ("auto", "concise", "detailed"). Empty clears it.