Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultBaseURL = "https://api.typesafe.ai" DefaultTimeout = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct {
*providerhttp.StatusError
Method string
Path string
Message string
}
APIError reports a non-successful TypeSafe API response.
type Answer ¶
type Answer struct {
Type string `json:"type"`
Choice *string `json:"choice,omitempty"`
Score *float64 `json:"score,omitempty"`
Noul *float64 `json:"noul,omitempty"`
Confidence *float64 `json:"confidence,omitempty"`
Probabilities map[string]float64 `json:"probabilities,omitempty"`
Legend map[string]json.RawMessage `json:"legend,omitempty"`
}
Answer is a TypeSafe primitive answer. Fields are populated according to Type.
func (*Answer) UnmarshalJSON ¶
UnmarshalJSON rejects null numeric probability values.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a native HTTP client for the TypeSafe System One API.
func (*Client) ListModels ¶
func (c *Client) ListModels(ctx context.Context) (*ModelsResponse, error)
ListModels lists models available to the account.
type Model ¶
type Model struct {
Name string `json:"name"`
Description string `json:"description"`
ReleaseDate string `json:"release_date"`
}
Model describes an available TypeSafe model.
type ModelsResponse ¶
type ModelsResponse struct {
Models []Model `json:"models"`
Raw json.RawMessage `json:"-"`
}
ModelsResponse is the /v1/models response.
type Question ¶
type Question struct {
Type string `json:"type"`
Instructions json.RawMessage `json:"instructions"`
Criteria json.RawMessage `json:"criteria,omitempty"`
}
Question describes one typed TypeSafe question.
type Request ¶
type Request struct {
State json.RawMessage `json:"state"`
Model string `json:"model"`
Questions map[string]Question `json:"questions"`
}
Request is the /v1/systemone classification request.
Click to show internal directories.
Click to hide internal directories.