MockAnthropic
Mock implementation of an Anthropic-compatible service for testing purposes.
This class provides an HTTP mock server to simulate Anthropic's Messages API. Extends AbstractMockLlm to provide Anthropic-specific functionality.
Author
Konstantin Pavlov
Parameters
port
The port on which the mock server will run. Defaults to 0, which allows the server to select an available port.
verbose
Controls whether the mock server's operations are logged in detail. Defaults to true.
Functions
Link copied to clipboard
fun messages(name: String? = null, block: Consumer<AnthropicMessagesRequestSpecification>): AnthropicBuildingStep
Java-friendly overload that accepts a Consumer for configuring the chat request.
fun messages(name: String? = null, block: AnthropicMessagesRequestSpecification.() -> Unit): AnthropicBuildingStep
Sets up a mock handler for the Anthropic /v1/messages endpoint.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard