Versions in this module Expand all Collapse all v0 v0.1.0 Sep 12, 2026 Changes in this version + const AgentChat + const AgentCommon + const SourceSystem + func AgentID(modelName string) string + func ContainsDSMLSentinel(s string) bool + func HasToolCalls(value any) bool + func IsAgentCommonModel(modelName string) bool + func IsDone(raw []byte) bool + func ModelConfigSource(modelName string) string + func NormalizeAssistantToolCallContent(messages []map[string]any) []map[string]any + func NormalizeUsage(usage gjson.Result) json.RawMessage + func NormalizeUsageBytes(raw []byte) json.RawMessage + func ResidualSanitizerCheck(sanitized string) bool + func ResolveErrorDetails(outerMessage, outerType, outerCode string, details json.RawMessage) (string, string, string) + func SanitizeText(content string, opts SanitizeOptions) (string, []ToolCallDelta, []Diagnostic) + func StripSSEPrefix(raw []byte) []byte + func UnwrapBody(raw []byte) []byte + type DSMLMode uint8 + const DSMLDisabled + const DSMLRecover + const DSMLStrip + type Diagnostic struct + Kind DiagnosticKind + Origin tagOrigin + Text string + Tool string + func (d Diagnostic) String() string + type DiagnosticKind uint8 + const DiagDroppedMarkup + const DiagDuplicateCall + const DiagRecoveredCall + const DiagResidualDSML + const DiagUnknownTool + func (k DiagnosticKind) String() string + type ErrorInfo struct + Code string + Message string + StatusCode int + Type string + func ParseError(raw []byte) (*ErrorInfo, bool) + type Role uint8 + const RoleAssistant + const RoleTool + const RoleUser + type SSEEvent struct + Content string + ErrorCode string + ErrorMsg string + ErrorType string + FinishReason string + FirstTokenDuration int + HasError bool + Raw []byte + ReasoningContent string + ToolCalls []ToolCallDelta + Type string + Usage *Usage + type SanitizeOptions struct + DSMLMode DSMLMode + KnownTools map[string]bool + MaxHoldBytes int + Role Role + ThoughtTags bool + type Sanitizer struct + func NewSanitizer(opts SanitizeOptions) *Sanitizer + func (s *Sanitizer) Diagnostics() []Diagnostic + func (s *Sanitizer) Feed(chunk string) []SSEEvent + func (s *Sanitizer) Flush() []SSEEvent + func (s *Sanitizer) NoteNativeToolCalls(calls []ToolCallDelta) + type TokenDetails struct + CachedTokens int + ReasoningTokens int + type ToolCallDelta struct + Arguments string + ID string + Index int + Name string + type Usage struct + CachedTokens int + CompletionTokens int + CompletionTokensDetails *TokenDetails + InputTokens int + InputTokensDetails *TokenDetails + OutputTokens int + OutputTokensDetails *TokenDetails + PromptTokens int + PromptTokensDetails *TokenDetails + ReasoningTokens int + TotalTokens int + func (u *Usage) Consolidate() + func (u *Usage) UnmarshalJSON(data []byte) error