GenerateRequest

data class GenerateRequest(val model: String, val prompt: String? = null, val suffix: String? = null, val images: List<String>? = null, val think: Boolean? = null, val format: Format? = null, val options: ModelOptions? = null, val system: String? = null, val template: String? = null, val stream: Boolean = true, val raw: Boolean? = null, val keepAlive: String? = null, val context: List<Int>? = null)(source)

Represents a request to generate a completion for a given prompt with a provided model.

Constructors

Link copied to clipboard
constructor(model: String, prompt: String? = null, suffix: String? = null, images: List<String>? = null, think: Boolean? = null, format: Format? = null, options: ModelOptions? = null, system: String? = null, template: String? = null, stream: Boolean = true, raw: Boolean? = null, keepAlive: String? = null, context: List<Int>? = null)

Properties

Link copied to clipboard

The context parameter returned from a previous request, used to keep a short conversational memory

Link copied to clipboard

The format to return a response in. Format can be "json" or a JSON schema

Link copied to clipboard

A list of base64-encoded images (for multimodal models such as llava)

Link copied to clipboard
@SerialName(value = "keep_alive")
val keepAlive: String?

Controls how long the model will stay loaded into memory following the request (default: "5m")

Link copied to clipboard

The model name to use for generation (required)

Link copied to clipboard

Additional model parameters such as temperature

Link copied to clipboard

The prompt to generate a response for

Link copied to clipboard
val raw: Boolean?

If true no formatting will be applied to the prompt

Link copied to clipboard

If false the response will be returned as a single response object, rather than a stream of objects

Link copied to clipboard

The text after the model response

Link copied to clipboard

System message (overrides what is defined in the Modelfile)

Link copied to clipboard

The prompt template to use (overrides what is defined in the Modelfile)

Link copied to clipboard

Should the model think before responding? (for thinking models)