Documentation
¶
Overview ¶
Package modelclient is the agent under test as the eval harnesses reach it: an OpenAI-compatible chat-completions endpoint, temperature 0, read as a stream so tool arguments arrive as the model wrote them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
URL string // full chat-completions endpoint
Model string
HTTP *http.Client
// ToolChoice, when set, replaces "auto": the benefit benchmark's forced
// arm names the one function the model must call.
ToolChoice any
// ReportUsage asks the server to close the stream with token counts.
ReportUsage bool
}
Client is one model behind a chat-completions endpoint.
func (*Client) Chat ¶
func (m *Client) Chat(ctx context.Context, messages []Message, tools []map[string]any) (Message, error)
Chat sends the transcript plus the tool definitions, temperature 0, and reads the answer as a stream. Streaming is for fidelity, not speed: asked for a whole message, a server has to parse the model's tool arguments, and ds4 hands unparseable ones over as {} — erasing what the model wrote and earning it a rejection about a call it never made. The stream carries the arguments as written. Transient transport failures and 429/5xx responses are retried with backoff: a gate run makes hundreds of calls against a local model server over roughly an hour, and one blip must not abort the whole run. Per-turn deadlines and an outer cancel are never retried.