Available on crate feature
test-utils only.Expand description
Test utilities for deterministic completion-model tests.
Structs§
- Append
Failing Memory - Memory backend that loads empty history and always fails on append.
- Barrier
Mock Tool Index - A vector index that waits at a barrier before returning one tool ID.
- Captured
Http Request - Request data captured by
RecordingHttpClient. - Counting
Memory - Memory backend that records load and append calls while delegating storage to
InMemoryConversationMemory. - Failing
Memory - Memory backend that always fails on load and no-ops append and clear.
- Foo
- Document fixture returned by
MockVectorStoreIndexin pipeline tests. - Mock
AddTool - A mock tool that adds
xandy. - Mock
Barrier Tool - A mock tool that waits at a barrier before returning
"done". - Mock
Completion Model - A cloneable scripted
CompletionModelfor tests. - Mock
Controlled Tool - A mock tool that notifies when started and waits for an explicit finish signal.
- Mock
Embedding Model - A deterministic
EmbeddingModelthat returns a fixed vector for each input document. - Mock
Example Tool - A mock tool named
example_toolthat returns"Example answer". - Mock
Image Generator Tool - A mock tool named
generate_test_imagethat returns a 1x1 red PNG image payload. - Mock
Image Output Tool - A mock tool that returns image JSON as a string.
- Mock
Model Lister - A
ModelListerthat returns a preconfigured list of models. - Mock
Multi Text Document - A test document that contributes multiple text fragments to an embedding request.
- Mock
Object Output Tool - A mock tool that returns a JSON object.
- Mock
Operation Args - Arguments for arithmetic mock tools.
- Mock
Prompt Model - A prompt model that echoes user text with a stable prefix.
- Mock
Response - Raw mock response used by completion and streaming test utilities.
- Mock
Streaming Client - A mock HTTP client that returns pre-built SSE bytes from
send_streaming. - Mock
String Output Tool - A mock tool that returns a multiline string.
- Mock
Subtract Tool - A mock tool that subtracts
yfromx. - Mock
Text Document - A test document that contributes one text fragment to an embedding request.
- Mock
Tool Error - Shared error type for mock tools.
- Mock
Tool Index - A vector index that returns a predefined list of tool IDs from
top_n_ids. - Mock
Turn - A scripted non-streaming mock completion turn.
- Mock
Vector Store Index - A vector index that always returns one JSON document containing
{"foo":"bar"}. - Recording
Http Client - An
HttpClientExtimplementation that records unary requests and returns a fixed response. - Sequenced
Streaming Http Client - An
HttpClientExtimplementation that returns one scripted stream of byte chunks fromsend_streaming.
Enums§
- Mock
Error - Scripted error returned by
MockCompletionModel. - Mock
Http Response - Response scripted for
RecordingHttpClient. - Mock
Stream Event - Scripted streaming event yielded by
MockCompletionModel.
Functions§
- mock_
math_ toolset - Create a
ToolSetcontainingMockAddToolandMockSubtractTool.