Versions in this module Expand all Collapse all v0 v0.6.0 Sep 11, 2026 v0.2.2 Aug 3, 2026 Changes in this version + const DefaultBaseDelay + const DefaultCooldownDuration + const DefaultHandshakeTimeout + const DefaultIdleConnTimeout + const DefaultMaxDelay + const DefaultMaxRetries + const DefaultRequestTimeout + const DefaultRetryStatusCodes + const DefaultTimeout + const StreamChannelBuffer + var Version = "dev" + func ApplyGuardrails(ctx context.Context, resp *EyrieResponse, g *Guardrails) error + func ApplyRedactions(response string, violations []GuardrailViolation) string + func AudioFormatToMediaType(format string) string + func CloseIdleConnections() + func DoWithRetry(ctx context.Context, httpClient *http.Client, req *http.Request, ...) (*http.Response, error) + func Emit(ctx context.Context, ch chan<- EyrieStreamEvent, evt EyrieStreamEvent) + func FormatAPIError(provider, op string, statusCode int, requestID string, d ProviderErrorDetail, ...) error + func IsRetriableError(err error) bool + func NewPooledHTTPClient(timeout time.Duration) *http.Client + func NormalizeImageSource(src string) (mediaType, data string, isBase64 bool, err error) + func OpenAIImageURL(src string) string + func ParseImageString(img string) (mediaType, data string, isBase64 bool) + func ParseSSEStream(ctx context.Context, body io.ReadCloser, logger *slog.Logger) <-chan SSEEvent + func ProcessAnthropicStream(ctx context.Context, sseEvents <-chan SSEEvent, logger *slog.Logger) <-chan EyrieStreamEvent + func ProcessAnthropicStreamWithOpts(ctx context.Context, sseEvents <-chan SSEEvent, logger *slog.Logger, ...) <-chan EyrieStreamEvent + func ProcessOpenAIStream(ctx context.Context, sseEvents <-chan SSEEvent, logger *slog.Logger) <-chan EyrieStreamEvent + func ProcessOpenAIStreamWithOpts(ctx context.Context, sseEvents <-chan SSEEvent, logger *slog.Logger, ...) <-chan EyrieStreamEvent + func ResponseHasContent(resp *EyrieResponse) bool + func SetVersion(v string) + func UserAgent() string + type ChatOptions = llm.ChatOptions + type ClientOption struct + func NewEyrieOption(fn func(EyrieConfigurable)) ClientOption + func NewOption(fn func(Configurable)) ClientOption + func WithAPIKey(key string) ClientOption + func WithBaseURL(url string) ClientOption + func WithGuardrailType(types ...GuardrailType) ClientOption + func WithGuardrails(rules ...GuardrailRule) ClientOption + func WithHTTPClient(hc *http.Client) ClientOption + func WithLogger(l *slog.Logger) ClientOption + func WithMaxTokens(n int) ClientOption + func WithMimoAuth() ClientOption + func WithModel(model string) ClientOption + func WithProviderName(name string) ClientOption + func WithRetry(rc RetryConfig) ClientOption + func WithTemperature(t float64) ClientOption + func WithTimeout(d time.Duration) ClientOption + func (o ClientOption) Apply(c Configurable) + func (o ClientOption) ApplyEyrie(e EyrieConfigurable) + type Configurable interface + SetAPIKey func(key string) + SetBaseURL func(url string) + SetDefaultMaxTokens func(n int) + SetDefaultModel func(model string) + SetDefaultTemperature func(t float64) + SetGuardrails func(g *Guardrails) + SetHTTPClient func(hc *http.Client) + SetLogger func(l *slog.Logger) + SetMimoAuth func() + SetProviderName func(name string) + SetRetry func(rc RetryConfig) + SetTimeout func(d time.Duration) + type ContentPart = llm.ContentPart + type ContinuationConfig = llm.ContinuationConfig + func DefaultContinuationConfig() ContinuationConfig + type Embedder interface + CreateEmbedding func(ctx context.Context, req EmbeddingRequest) (*EmbeddingResponse, error) + type EmbeddingParams struct + Indexing map[string]string + Query map[string]string + type EmbeddingRequest struct + Input []string + Model string + Params map[string]string + type EmbeddingResponse struct + Embeddings [][]float32 + Model string + Usage *EyrieUsage + type EyrieConfig = llm.EyrieConfig + type EyrieConfigurable interface + SetCoalescingTTL func(ttl time.Duration) + type EyrieError struct + Err error + Message string + Op string + Provider string + RequestID string + StatusCode int + func (e *EyrieError) Error() string + func (e *EyrieError) IsAuthError() bool + func (e *EyrieError) IsRateLimited() bool + func (e *EyrieError) IsRetriable() bool + func (e *EyrieError) Unwrap() error + type EyrieMessage = llm.EyrieMessage + func SanitizeMessages(messages []EyrieMessage) []EyrieMessage + type EyrieResponse = llm.EyrieResponse + func CopyResponse(resp *EyrieResponse) *EyrieResponse + type EyrieStreamEvent = llm.EyrieStreamEvent + type EyrieTool = llm.EyrieTool + type EyrieUsage = llm.EyrieUsage + type GuardrailAction string + const GuardrailBlock + const GuardrailRedact + const GuardrailWarn + type GuardrailError struct + Message string + Violations []GuardrailViolation + func (e *GuardrailError) Error() string + type GuardrailRule struct + Action GuardrailAction + Name string + Pattern string + Severity GuardrailSeverity + Type GuardrailType + func AllDefaultRules() []GuardrailRule + func DefaultHarmfulContentRules() []GuardrailRule + func DefaultPIIRules() []GuardrailRule + func DefaultPromptInjectionRules() []GuardrailRule + func DefaultSecretLeakRules() []GuardrailRule + func RulesForType(t GuardrailType) []GuardrailRule + type GuardrailSeverity string + const SeverityCritical + const SeverityHigh + const SeverityLow + const SeverityMedium + type GuardrailType string + const GuardrailCustom + const GuardrailHarmfulContent + const GuardrailPII + const GuardrailPromptInjection + const GuardrailSecretLeak + type GuardrailViolation struct + MatchedText string + RedactedResult string + Rule GuardrailRule + type Guardrails struct + func NewGuardrails(rules ...GuardrailRule) *Guardrails + func NewGuardrailsSafe(rules ...GuardrailRule) (*Guardrails, error) + func (g *Guardrails) AddRule(r GuardrailRule) + func (g *Guardrails) AddRuleSafe(r GuardrailRule) error + func (g *Guardrails) Check(ctx context.Context, response string) ([]GuardrailViolation, error) + func (g *Guardrails) Rules() []GuardrailRule + type ImageURLPart = llm.ImageURLPart + type InputAudioPart = llm.InputAudioPart + type Provider interface + Chat func(ctx context.Context, messages []EyrieMessage, opts ChatOptions) (*EyrieResponse, error) + Name func() string + Ping func(ctx context.Context) error + StreamChat func(ctx context.Context, messages []EyrieMessage, opts ChatOptions) (*StreamResult, error) + type ProviderErrorDetail struct + Code string + Message string + Raw string + Type string + func ParseProviderError(body io.ReadCloser) (ProviderErrorDetail, error) + type RepeatDetector struct + MinLength int + Threshold float64 + func DefaultRepeatDetector() *RepeatDetector + func (d *RepeatDetector) Add(delta string) bool + func (d *RepeatDetector) Feed(chunk string) + func (d *RepeatDetector) GetRepeatness() float64 + func (d *RepeatDetector) IsRepeating() bool + type ResponseFormat = llm.ResponseFormat + type ResponseHealth string + const ResponseEmpty + const ResponseErrorOnlyReasoning + const ResponseMalformedStream + const ResponseOK + func DetectResponseHealth(sig ResponseSignals) ResponseHealth + func (h ResponseHealth) Diagnostic() string + func (h ResponseHealth) Err() error + type ResponseSignals struct + ContentLen int + FinishReason string + SawReasoning bool + StreamEnded bool + StreamErr bool + ToolCalls int + type RetryConfig struct + RetryOn []int + func DefaultRetryConfig() RetryConfig + func NewRetryConfig(maxRetries int, baseDelay, maxDelay time.Duration, retryOn ...int) RetryConfig + func (rc RetryConfig) ShouldRetry(statusCode int) bool + type SSEEvent struct + Data string + Event string + type StreamGuardrailConfig struct + AccumulateForPII bool + BlockOnInjection bool + Enabled bool + MaxChunkSize int + type StreamGuardrailResult struct + Blocked bool + Chunk string + ModifiedChunk string + Violations []GuardrailViolation + type StreamGuardrails struct + func NewStreamGuardrails(guardrails *Guardrails, config StreamGuardrailConfig) *StreamGuardrails + func (sg *StreamGuardrails) Flush() []GuardrailViolation + func (sg *StreamGuardrails) IsBlocked() bool + func (sg *StreamGuardrails) ProcessChunk(chunk string) StreamGuardrailResult + func (sg *StreamGuardrails) Reset() + type StreamResult = llm.StreamResult + type ToolCall = llm.ToolCall + func ParseInlineToolCalls(text string) (cleanText string, toolCalls []ToolCall) + type ToolChoiceOption = llm.ToolChoiceOption + type ToolResult = llm.ToolResult