Versions in this module Expand all Collapse all v0 v0.2.0 Sep 27, 2026 Changes in this version + const MaxChoiceOptions + const MaxScoreLevels v0.1.0 Sep 18, 2026 Changes in this version + const DefaultBaseURL + const DefaultModel + const Version + var ErrAnswerNotFound = errors.New("answer not found") + var ErrAnswerType = errors.New("answer has unexpected type") + type APIError struct + Body []byte + Header http.Header + Message string + Method string + RequestID string + StatusCode int + URL string + func (e *APIError) Error() string + type Answer interface + func UnmarshalAnswer(data []byte) (Answer, error) + type ChoiceAnswer struct + Choice string + Confidence float64 + Probabilities map[string]float64 + func (a ChoiceAnswer) MarshalJSON() ([]byte, error) + type ChoiceQuestion struct + Criteria map[string]any + Instructions any + func (q ChoiceQuestion) MarshalJSON() ([]byte, error) + type Client struct + func NewClient(options ...Option) (*Client, error) + func (c *Client) ListModels(ctx context.Context) (*ListModelsResponse, error) + func (c *Client) SystemOne(ctx context.Context, request SystemOneRequest) (*SystemOneResponse, error) + type ListModelsResponse struct + Models []ModelCard + RequestID string + func (r *ListModelsResponse) UnmarshalJSON(data []byte) error + type ModelCard struct + Description string + Name string + ReleaseDate string + type NoulAnswer struct + Noul float64 + func (a NoulAnswer) MarshalJSON() ([]byte, error) + type NoulCriteria struct + False any + True any + type NoulQuestion struct + Criteria *NoulCriteria + Instructions any + func (q NoulQuestion) MarshalJSON() ([]byte, error) + type Option func(*clientConfig) error + func WithAPIKey(key string) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(client *http.Client) Option + func WithHeaders(headers http.Header) Option + func WithMaxRetries(maxRetries int) Option + func WithModel(model string) Option + func WithRetryPolicy(policy RetryPolicy) Option + func WithTimeout(timeout time.Duration) Option + type Question interface + func UnmarshalQuestion(data []byte) (Question, error) + type ResponseError struct + Err error + RequestID string + func (e *ResponseError) Error() string + func (e *ResponseError) Unwrap() error + type RetryPolicy struct + InitialDelay time.Duration + Jitter float64 + MaxDelay time.Duration + MaxRetries int + MaxRetryAfter time.Duration + RetryConnectionErrors bool + RetryTimeouts bool + func DefaultRetryPolicy() RetryPolicy + type ScoreAnswer struct + Confidence float64 + Legend map[string]any + Probabilities map[string]float64 + Score float64 + func (a ScoreAnswer) MarshalJSON() ([]byte, error) + type ScoreQuestion struct + Criteria []any + Instructions any + func (q ScoreQuestion) MarshalJSON() ([]byte, error) + type SystemOneRequest struct + Model string + Questions map[string]Question + State any + func (r SystemOneRequest) Validate() error + type SystemOneResponse struct + Answers map[string]Answer + Model string + RequestID string + Usage Usage + func (r *SystemOneResponse) UnmarshalJSON(data []byte) error + func (r SystemOneResponse) Answer[T Answer](name string) (T, error) + func (r SystemOneResponse) Choice(name string) (ChoiceAnswer, error) + func (r SystemOneResponse) Noul(name string) (NoulAnswer, error) + func (r SystemOneResponse) Score(name string) (ScoreAnswer, error) + type UnknownAnswer struct + Raw jsontext.Value + Type string + func (a UnknownAnswer) MarshalJSON() ([]byte, error) + type Usage struct + InputTokens int + OutputTokens int