Skip to main content

Module conformance

Module conformance 

Source
Expand description

A suite every chat adapter must pass. Port of wabot-ts/src/testing/conformance/chatAdapterConformanceCases.ts.

for case in chat_adapter_conformance(adapter, "gpt-4o-mini") {
    println!("{}: {:?}", case.name, case.run().await);
}

§What a conformance suite is for

Six adapters implement one trait, and each was tested against its own mock server — which proves each speaks its own provider’s dialect, and nothing at all about whether they behave the same. The differences that bite are not in the happy path: they are whether a tool call comes back with its arguments intact, whether usage is reported, whether a nulled optional argument survives the round trip. This suite is the same questions asked of every provider.

§Runner-agnostic on purpose

Each case is a name plus a boxed future, not a #[test]. An adapter crate wires them into its own test binary, and an application can run them against a provider it added itself — which is the point of publishing them rather than keeping them internal.

§What is deliberately not here yet

The TypeScript suite has cases this port cannot express:

  • Nested, enum and typed-array tool parameters. ToolSchema here is flat (name / type / description / required), a deliberate Phase-4e decision. An array’s item type reaches the model as a bare array, so a case asserting the model filled a string[] correctly would be testing a schema the port doesn’t emit.

Listed rather than quietly dropped: this is the checklist for when it lands.

Structs§

ConformanceCase
One case: a name and something to run.

Functions§

chat_adapter_conformance
Every case an adapter must pass, for model.