pub async fn text_model_conformance(model: &dyn TextModel)Expand description
Asserts the TextModel trait contract against a text model whose
transport is already scripted to complete
text_model_conformance_prompt with
TEXT_MODEL_CONFORMANCE_REPLY and the canonical counts in its
vendor’s wire shape. The suite makes exactly one complete call —
script that one request and no other.
Asserted, each panic naming the rule it caught:
textis the canonical reply, verbatim — no greeting, no chit-chat, no markdown fence around it;modelis non-empty — a completion names what answered, for the log line;- usage is reported on every completion:
input_tokensandoutput_tokensequal the scripted counts; cached_input_tokensis the scripted cache read, and never exceedsinput_tokens— the cached subset of a total cannot be larger than the total;- the prompt carried no schema, so
jsonisNone.
ⓘ
// In the adapter's own test, after scripting its transport:
text_model_conformance(&model).await;§Panics
Panics with the failing rule named when the contract is violated, and when the scripted completion fails.