Skip to main content

Module fake

Module fake 

Source
Expand description

A scriptable fake OpenAI-compatible server for tests (and loadmaster __fake-runtime).

By default it behaves like a correct runtime: tools in the request produce tool_calls whose arguments are built from the tool’s parameter schema, response_format produces JSON built from the schema, a tool message produces a final answer, and streaming splits everything across deltas. Each Misbehavior breaks one of those the way real runtimes do, so every failure class the probe knows can be exercised.

Structs§

Config

Enums§

Impersonate
Which runtime’s identifying endpoints and headers to imitate.
Misbehavior

Functions§

instance
A minimal instance of a JSON Schema: required properties, first enum value, first examples entry (which is how fixtures satisfy pattern), first anyOf branch.
router
serve
Serve on listener until the process ends.