Documentation
¶
Overview ¶
Package systemone answers OpenAI Decisions requests with TypeSafe's System One API, which asks the same three kinds of question under other names: a predicate is a noul, and choice and score keep their names. It serves every provider whose upstream speaks System One: jev (hosted Jev and self-hosted Kev servers) and OpenRouter, which serves Jev and Kev natively.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnswerDecisions ¶
func AnswerDecisions(ctx context.Context, req *core.PassthroughRequest, send Sender, opts Options) (*core.PassthroughResponse, error)
AnswerDecisions answers an OpenAI Decisions request with System One. The request is translated to a System One request, sent to /v1/systemone through send, and the answer translated back, so the caller sees OpenAI's shapes. Members System One has no place for (prompt caching, safety_identifier) are dropped. Images become System One image assets, which TypeSafe serves only with the TypeSafe-Danger-Zone-Images header; the gateway does not fetch images, so they must arrive inline as base64 data URLs.
Types ¶
type Options ¶
type Options struct {
// ProviderType names the provider in errors.
ProviderType string
// ImagesRefusal, when set, refuses a request with images with this
// message: the upstream reads text only.
ImagesRefusal string
}
Options describe the provider a Decisions request is answered for.
type Sender ¶
type Sender func(ctx context.Context, req *core.PassthroughRequest) (*core.PassthroughResponse, error)
Sender sends one System One request upstream: a provider's Passthrough.