Versions in this module Expand all Collapse all v0 v0.1.0 Nov 24, 2026 Changes in this version + const DefaultBaseURL + const DefaultMaxRetries + const DefaultTimeout + const SDKVersion + func IsAuthenticationError(err error) bool + func IsNotFoundError(err error) bool + func IsPermissionError(err error) bool + func IsRateLimitError(err error) bool + func IsValidationError(err error) bool + func ShouldEscalateDecision(resp *DecisionResponse, opts EscalationOptions) bool + type APIError struct + Body []byte + Message string + RequestID string + RetryAfter *float64 + StatusCode int + func (e *APIError) Error() string + type APIKeyInfo struct + CreatedAt string + Environment string + ExpiresAt *string + ID string + IsActive bool + KeyPrefix string + LastUsedAt *string + Name string + Scopes []string + type APIKeysService struct + func (s *APIKeysService) Create(ctx context.Context, req CreateAPIKeyRequest) (*CreateAPIKeyResponse, error) + func (s *APIKeysService) List(ctx context.Context) ([]APIKeyInfo, error) + func (s *APIKeysService) Revoke(ctx context.Context, keyID string) (map[string]any, error) + func (s *APIKeysService) Rotate(ctx context.Context, keyID string, req RotateAPIKeyRequest) (*RotateAPIKeyResponse, error) + type BatchRecordOutcomeRequest struct + Items []RecordOutcomeRequest + type Candidate struct + Description string + ID string + Label string + type Client struct + APIKeys *APIKeysService + Engines *EnginesService + Feedback *FeedbackService + Provenance *ProvenanceService + Usage *UsageService + func NewClient(opts ...Option) *Client + func (c *Client) Decide(ctx context.Context, req DecisionRequest) (*DecisionResponse, error) + func (c *Client) Evaluate(ctx context.Context, req EvaluateRequest) (*EvaluateResponse, error) + func (c *Client) Health(ctx context.Context) (map[string]any, error) + type CreateAPIKeyRequest struct + Environment string + Name string + Scopes []string + type CreateAPIKeyResponse struct + CreatedAt string + Environment string + ID string + Key string + KeyPrefix string + Name string + Scopes []string + type CustomerFeedbackRequest struct + OperatorNotes *string + RequestID string + VerifiedDecision any + WasAccurate bool + type CustomerFeedbackResponse struct + RecordedAt string + RequestID string + Status string + type DecisionItem struct + CandidateID string + ConfidenceIndex float64 + ConfidenceTier string + Margin *float64 + Probability float64 + type DecisionRequest struct + Choices []any + Engine string + State string + Temperature *float64 + TopK *int + type DecisionResponse struct + Decisions []DecisionItem + Engine string + RequestID string + State string + TopChoice *string + UncertaintyEntropy float64 + type DplBundle struct + Manifest map[string]any + Outcome map[string]any + Record map[string]any + SchemaVersion string + Signature map[string]any + StateDisclosure map[string]any + type EngineStatus struct + Classes []string + Description string + Enabled bool + IsTrained *bool + Name string + Status string + Tier string + type EnginesService struct + func (s *EnginesService) List(ctx context.Context) ([]EngineStatus, error) + type EscalationOptions struct + MaxEntropy *float64 + MinConfidenceTier string + MinMargin *float64 + type EvaluateRequest struct + Engine string + Evaluations map[string]any + State string + Temperature *float64 + type EvaluateResponse struct + Engine string + RequestID string + Results map[string]map[string]any + State string + Usage UsageModel + type ExportBundleRequest struct + OutputName *string + PresentedState *string + RequestID string + type FeedbackService struct + func (s *FeedbackService) Submit(ctx context.Context, req CustomerFeedbackRequest) (*CustomerFeedbackResponse, error) + type Option func(*Client) + func WithAPIKey(apiKey string) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(httpClient *http.Client) Option + func WithHeader(key, value string) Option + func WithMaxRetries(retries int) Option + func WithTimeout(timeout time.Duration) Option + type ProvenanceRecordsParams struct + ExecutionStage string + FromSeq *int + Limit *int + Offset *int + Order string + PrimitiveType string + RequestID string + Status string + ToSeq *int + type ProvenanceService struct + func (s *ProvenanceService) Calibration(ctx context.Context) (map[string]any, error) + func (s *ProvenanceService) Chain(ctx context.Context, fromSeq, limit *int) (map[string]any, error) + func (s *ProvenanceService) Export(ctx context.Context, req ExportBundleRequest) (map[string]any, error) + func (s *ProvenanceService) GetRecord(ctx context.Context, entryID string) (map[string]any, error) + func (s *ProvenanceService) GetRequest(ctx context.Context, requestID string) (map[string]any, error) + func (s *ProvenanceService) Keys(ctx context.Context) (map[string]any, error) + func (s *ProvenanceService) Manifest(ctx context.Context) (map[string]any, error) + func (s *ProvenanceService) Metrics(ctx context.Context) (map[string]any, error) + func (s *ProvenanceService) RecordOutcome(ctx context.Context, req RecordOutcomeRequest) (map[string]any, error) + func (s *ProvenanceService) RecordOutcomesBatch(ctx context.Context, req BatchRecordOutcomeRequest) (map[string]any, error) + func (s *ProvenanceService) Records(ctx context.Context, params ProvenanceRecordsParams) (map[string]any, error) + func (s *ProvenanceService) Verify(ctx context.Context, bundle DplBundle) (map[string]any, error) + type RecordOutcomeRequest struct + ObservedEffect any + OutputName *string + RequestID string + type RotateAPIKeyRequest struct + GracePeriodMinutes int + type RotateAPIKeyResponse struct + NewKey CreateAPIKeyResponse + PreviousKeyExpiresAt *string + PreviousKeyRevokedImmediately bool + RotatedKeyID string + type UsageEngineBreakdown struct + Decisions int + Engine string + Evaluations int + Tokens int + type UsageModel struct + EvaluationTokens int + EvaluationsCount int + LatencyMs float64 + StateTokens int + TotalTokens int + type UsageService struct + func (s *UsageService) Summary(ctx context.Context) (*UsageSummaryResponse, error) + func (s *UsageService) Timeseries(ctx context.Context, days *int) (*UsageTimeseriesResponse, error) + type UsageSummaryResponse struct + AvgLatencyMs float64 + ByEngine []UsageEngineBreakdown + DecisionsUsed int + EvaluationsUsed int + MonthlyLimit int + OrganizationID string + PeriodYM string + PlanName string + PlanSlug string + RemainingQuota int + SubscriptionStatus string + TotalTokens int + type UsageTimeseriesPoint struct + AvgLatencyMs float64 + Date string + Decisions int + Evaluations int + Tokens int + type UsageTimeseriesResponse struct + Days int + OrganizationID string + Points []UsageTimeseriesPoint