1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Fixtures specific to the chain suite.
//!
//! Everything that talks to a mock endpoint (`cfg_for`, `sse`, `mount_sse`,
//! `server_returning`, `server_failing_with`, `request_count`,
//! `fast_retry_chain`, `temp_cache`) lives in `crate::test_support`, shared
//! with the client and analysis suites. What is left here is naming: each
//! wrapper below exists for its doc paragraph, not for its body.
use MockServer;
use crate;
/// The system prompt and payload every chain test sends. Constants rather than
/// literals at each call site because the cache-key assertions have to name the
/// *same* two strings the request used, and a typo in one of them would make a
/// key comparison pass for the wrong reason.
pub const SYSTEM: &str = "system prompt";
/// See [`SYSTEM`].
pub const CONTENT: &str = "user content";
/// A body the JSON extractor accepts, shaped like a real analyzer response.
pub const GOOD_JSON: &str = r#"{"issues": [], "summary": "clean"}"#;
/// A server that answers 200 with a well-formed but content-free SSE stream.
///
/// The SDK yields zero text here, which drep classifies as a *transport*
/// failure rather than a parse failure - the distinction the empty-body
/// failover rule rests on.
pub async
/// A server that answers 200 with prose containing no JSON at all.
pub async
/// A server that answers 200 with a clean analyzer response.
pub async
/// A server that answers with prose and reports the output cap.
///
/// Produces `LlmError::ModelStopped`, which is request-shaped: it must neither
/// advance the chain nor demote the provider.
pub async