Documentation
¶
Overview ¶
Package system1go provides explicit, lossless System One and Decisions clients.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
type Answer struct {
ConfidenceSource Protocol
Status Status
Type Kind
Probability *float64
Choice any
Score *float64
ComputedScore *float64
Confidence *float64
Probabilities []Distribution
Levels []Level
Issues []string
Raw json.RawMessage
}
Answer is usable only when Status is OK. Numeric pointers preserve absence. Confidence is provider-specific certainty, not a universal correctness probability. Score is original; ComputedScore is separate verification, never an overwrite.
type Capabilities ¶
type Capabilities struct {
MinChoices, MaxChoices, MinLevels, MaxLevels, MaxQuestions int
BooleanChoices, StructuredInstructions, Refusal bool
}
Capabilities declares the implemented common surface, not all server features.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is safe for concurrent calls with independently owned request data.
func (*Client) Capabilities ¶
func (c *Client) Capabilities() Capabilities
Capabilities returns a copy of this client's declared protocol limits.
func (*Client) Decide ¶
Decide validates and snapshots the request, then makes exactly one HTTP request. The context and configured timeout cover response body consumption.
type Config ¶
type Config struct {
Protocol Protocol
Provider string
BaseURL string
Model string
APIKey string
Headers http.Header
HTTPClient *http.Client
Timeout time.Duration
MaxResponseBytes int64
MaxRequestBytes int64
ExtraBodyKeys []string
MaxQuestions int
MaxChoices int
MaxLevels int
}
Config is snapshotted by NewClient. Zero timeout and byte budgets use safe defaults. MaxQuestions/MaxChoices/MaxLevels and ExtraBodyKeys apply to native deployments only. HTTPClient is copied; its shared Transport/Jar must obey normal net/http concurrency rules.
type Decision ¶
type Decision struct {
Protocol Protocol
Provider string
Answers map[string]Answer
Raw json.RawMessage
Metadata map[string]json.RawMessage
Usage json.RawMessage
ActualModel string
RequestedModel string
Issues []string
HTTP HTTPMetadata
}
Decision retains normalized answers and original response evidence. Usage is nil when absent; Raw and Metadata may contain sensitive input.
type Distribution ¶
Distribution preserves typed choice values or zero-based integer score indices.
type Error ¶
type Error struct {
Protocol Protocol
Provider string
Code string
Question string
Feature string
Status int
HTTP HTTPMetadata
// contains filtered or unexported fields
}
Error is a safe ordinary error; explicit Diagnostics and Cause may be sensitive. Use errors.As to inspect Code, Question, Feature and HTTP status.
func (*Error) Cause ¶
Cause explicitly exposes the original transport error; it may contain sensitive URLs.
func (*Error) Diagnostics ¶
Diagnostics explicitly returns potentially sensitive upstream bytes. Never log automatically.
type HTTPMetadata ¶
HTTPMetadata includes only status and an allowlisted subset of response headers.
type Protocol ¶
type Protocol string
Protocol identifies a wire contract independently of provider or model.
type Question ¶
type Question struct {
Name string
Type Kind
Instructions any
Criteria map[string]any
Choices []Option
Levels []Level
}
Question is a named primitive. Only fields appropriate to Type may be set. Native Instructions may be nil or structured; OpenAI requires text.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
providers
command
Inspect provider-specific wire shapes offline.
|
Inspect provider-specific wire shapes offline. |
|
quickstart
command
This runnable example uses synthetic loopback HTTP, never a real model.
|
This runnable example uses synthetic loopback HTTP, never a real model. |