Documentation
¶
Overview ¶
Package systemonetest provides a fake System One endpoint for the tests of the plugins that serve decision models.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// Models is the reply to a GET, the model listing. When empty, a GET
// fails with a server error.
Models string
// Usage, when set, is the usage of every answer, in place of 312
// input tokens and 48 output tokens.
Usage map[string]any
// Wrap, when set, wraps every answer in a server's envelope.
Wrap func(reply map[string]any) any
// contains filtered or unexported fields
}
Server answers whatever questions it is sent, so a test can check the whole path from a Go type to the wire and back. A choice is answered with its first option by name, a score with 1.3, a noul with 0.93, from the model jev-1.13.0 with 312 input tokens and 48 output tokens.
func (*Server) Last ¶
Last is the last request posted and its JSON body. It fails the test when nothing was posted.
func (*Server) ServeHTTP ¶
func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Handler.
Click to show internal directories.
Click to hide internal directories.