inputContains

fun inputContains(substring: String)(source)

Adds a matcher that checks if the input contains the specified substring.

This method is useful for matching embedding requests where the input text contains specific words or phrases, without requiring an exact match of the entire input.

Example:

openai.embeddings {
model = "text-embedding-3-small"
inputContains("Hello")
inputContains("world")
} responds {
embeddings(listOf(0.1f, 0.2f, 0.3f))
}

Parameters

substring

The substring that must be present in the input text.

See also