completion

Java-friendly overload that accepts a Consumer for configuring the chat request.

Return

An OpenaiChatCompletionsBuildingStep for configuring mock response behavior.

Parameters

name

An optional identifier for the mock configuration.

block

A Consumer to configure the specifications via OpenaiChatCompletionRequestSpecification.


Configures and constructs a mock handler for the OpenAI /v1/chat/completions endpoint.

This method allows you to define specifications and criteria for chat completion requests, enabling controlled responses for testing and simulations.

Return

An instance of OpenaiChatCompletionsBuildingStep, representing a builder step for configuring mock response behavior.

Parameters

name

An optional identifier for the mock configuration. Defaults to null if not provided.

block

A lambda function to configure the specifications for the chat completion request, using the OpenaiChatCompletionRequestSpecification object.

See also