Versions in this module Expand all Collapse all v1 v1.14.0 Oct 19, 2026 Changes in this version + const EnumQuestionID + const FalseKeyword + const GuidanceKeyword + const InstructionsKeyword + const KindChoice + const KindKeyword + const KindNoul + const KindScore + const LevelsKeyword + const RequestTimeout + const TrueKeyword + func AnswersText(resp *Response, questions map[string]Question, enum bool) (string, error) + func CompileQuestions(schema map[string]any, preamble string) (map[string]Question, error) + func EnumQuestion(schema map[string]any, preamble string) (map[string]Question, error) + func ErrorMessage(body []byte) string + func NewModel(c *Client, name, id string, spec Spec) *ai.ModelAction + func SystemPreamble(messages []*ai.Message) (string, error) + type Client struct + APIKey string + BaseURL string + Endpoint *Endpoint + HTTP *http.Client + Headers http.Header + func (c *Client) Decide(ctx context.Context, model string, req *Request) (*Response, error) + func (c *Client) ListModels(ctx context.Context) ([]ModelInfo, error) + type Config struct + Extra map[string]any + StateJSON bool + type Endpoint struct + ModelsPath string + Name string + Path string + Route func(model string, body map[string]any) (suffix string, out any, err error) + Unwrap func(body []byte) ([]byte, error) + type Info struct + Answers map[string]map[string]any + ID string + Model string + Provider string + type Media struct + Audio []string + Images []string + Videos []string + func BuildState(req *ai.ModelRequest, stateJSON bool, reads Reads) (any, Media, error) + type ModelInfo struct + Description string + ID string + Name string + ReleaseDate string + func (m ModelInfo) Model() string + type Option struct + Description any + Name string + type Options []Option + func (c Options) MarshalJSON() ([]byte, error) + type Question struct + Criteria any + Instructions any + Labels []string + Type string + type Reads struct + Audio bool + Images bool + Video bool + type Request struct + Extra map[string]any + Media Media + Questions map[string]Question + State any + func (r *Request) Body(model string) map[string]any + type Response struct + Usage struct{ ... } + type Spec struct + Label string + Reads Reads