GeminiContentResponseSpecification

class GeminiContentResponseSpecification(var content: String = "This is a mock response from Gemini API.", var finishReason: String = "STOP", var role: String = "model", delay: Duration = Duration.ZERO) : AbstractResponseSpecification<GenerateContentRequest, GenerateContentResponse> (source)

Specification for configuring a Gemini content generation response.

This class provides a fluent API for configuring the response that will be returned by the mock Gemini API when a content generation request is made.

Constructors

Link copied to clipboard
constructor(content: String = "This is a mock response from Gemini API.", finishReason: String = "STOP", role: String = "model", delay: Duration = Duration.ZERO)

Properties

Link copied to clipboard

The content to include in the response.

Link copied to clipboard
Link copied to clipboard

The reason why the model stopped generating tokens.

Link copied to clipboard

Functions

Link copied to clipboard

Builds a GenerateContentResponse based on the current specification.

Link copied to clipboard

Sets the content of the response.

Link copied to clipboard
open override fun delayMillis(value: Long)
Link copied to clipboard

Sets the finish reason for the response.

Link copied to clipboard

Sets the role for the response content.