OpenaiChatCompletionRequestSpecification

Represents the specification for an OpenAI chat completion request.

Extends ModelRequestSpecification specifically for configuring and validating parameters related to ChatCompletionRequest objects. This includes overriding methods to add matchers for specific conditions such as ensuring messages from the system or user contain specified substrings.

Author

Konstantin Pavlov

See also

Constructors

Link copied to clipboard
constructor(seed: Int? = null)

Creates an instance with optional parameters for initializing configuration.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var seed: Int?

An optional seed value for deterministic behavior in chat completions.

Link copied to clipboard
Link copied to clipboard
var topK: Long?
Link copied to clipboard
var topP: Double?

Functions

Link copied to clipboard
fun hasToolWithFunction(functionName: String)

Adds a matcher to verify that the request includes a tool with the specified function name.

Link copied to clipboard
Link copied to clipboard
fun requestMatches(matcher: Matcher<ChatCompletionRequest?>)
Link copied to clipboard
Link copied to clipboard
fun requestSatisfies(description: String?, call: (ChatCompletionRequest?) -> Unit)
Link copied to clipboard

Sets the seed value for deterministic behavior in chat completions.

Link copied to clipboard
inline fun systemMessageContains(builderAction: StringBuilder.() -> Unit)
open override fun systemMessageContains(substring: String)
Link copied to clipboard
fun toolHasParameter(functionName: String, parameterName: String)

Adds a matcher to verify that a tool's function has a parameter with the specified name.

fun toolHasParameter(functionName: String, parameterName: String, description: String)

Adds a matcher to verify that a tool's function has a parameter with the specified name and description.

Link copied to clipboard
fun toolParameterHasType(functionName: String, parameterName: String, expectedType: String)

Adds a matcher to verify that a tool's function parameter has the specified type.

Link copied to clipboard
fun toolRequiresParameters(functionName: String, vararg requiredParams: String)

Adds a matcher to verify that a tool's function requires specific parameters.

Link copied to clipboard
inline fun userMessageContains(builderAction: StringBuilder.() -> Unit)
open override fun userMessageContains(substring: String)