OllamaEmbedBuildingStep

OllamaEmbedBuildingStep is a specialized implementation of AbstractBuildingStep intended for constructing and managing embedding responses as part of the Ollama Mock Server setup.

The class provides features to create responses for simulated embedding requests. It extends the functionality of AbstractBuildingStep by applying specific logic for generating fake responses compliant with Ollama's embedding API.

Parameters

mokksy

The mock server instance used for handling mock request and response lifecycle.

buildingStep

The underlying building step for managing and supporting response configurations for Ollama Embedding requests.

Constructors

Link copied to clipboard
constructor(mokksy: MokksyServer, buildingStep: BuildingStep<EmbeddingsRequest>)

Initializes the building step with the provided mock server instance and a higher-level building step for configuring embedding responses.

Functions

Link copied to clipboard

open infix override fun responds(block: suspend OllamaEmbedResponseSpecification.() -> Unit)

Configures the mock embedding response for an embedding request using the provided specification block.

Link copied to clipboard
open infix fun <R : Any> respondsError(block: Consumer<ResponseDefinitionBuilder<EmbeddingsRequest, R>>)
open infix fun <T : Any> respondsError(block: suspend ResponseDefinitionBuilder<EmbeddingsRequest, T>.() -> Unit)
open fun <T : Any> respondsError(responseType: KClass<T>, block: suspend ResponseDefinitionBuilder<EmbeddingsRequest, T>.() -> Unit)