OpenaiEmbedRequestSpecification

Specification for matching OpenAI embedding requests.

This class is used to specify the criteria for matching requests to the OpenAI embeddings endpoint. It allows specifying the model, input (string or list of strings), dimensions, encoding format, and user ID.

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

The number of dimensions the resulting output embeddings should have

Link copied to clipboard

The format to return the embeddings in

Link copied to clipboard

The model ID to match in the request

Link copied to clipboard

The request body matchers

Link copied to clipboard

Additional string matchers for the request body

Link copied to clipboard

The string input to match in the request

Link copied to clipboard

The list of string inputs to match in the request

Link copied to clipboard
var user: String?

A unique identifier representing your end-user

Functions

Link copied to clipboard

Sets the number of dimensions the resulting output embeddings should have.

Link copied to clipboard

Sets the encoding format for the embedding request.

Link copied to clipboard
fun inputContains(substring: String)

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

Link copied to clipboard

Sets the model ID criterion for matching embedding requests.

Link copied to clipboard

Sets the full request body for embedding request matching.

Link copied to clipboard

Adds a string matcher to the list of request body matchers for this specification.

Link copied to clipboard

Adds a string matcher to the list of request body matchers for this specification.

Link copied to clipboard

Sets a single string input for embedding generation, clearing any existing list input.

Link copied to clipboard

Sets the list of string inputs for embedding generation, clearing any previously set single string input.

Link copied to clipboard

Sets the user identifier for the embedding request.