Package-level declarations

Types

Link copied to clipboard
data class ChatRequest(val model: String, val messages: List<Message>, val tools: List<Tool>? = null, val think: Boolean? = null, val format: Format? = null, val options: ModelOptions? = null, val stream: Boolean = true, val keepAlive: String? = null)

Represents a request to generate the next message in a chat with a provided model.

Link copied to clipboard
data class ChatResponse(val model: String, val createdAt: Instant, val message: Message, val done: Boolean, val doneReason: String? = null, val totalDuration: Long? = null, val loadDuration: Long? = null, val promptEvalCount: Int? = null, val promptEvalDuration: Long? = null, val evalCount: Int? = null, val evalDuration: Long? = null)

Represents a response from the chat completion endpoint.

Link copied to clipboard
data class FunctionCall(val name: String, val arguments: String)

Represents a function call made by the model.

Link copied to clipboard
data class FunctionDefinition @JvmOverloads constructor(val name: String, val description: String? = null, val parameters: JsonSchema)

Represents a function definition that can be called by the model.

Link copied to clipboard
data class Message(val role: String, val content: String, val thinking: String? = null, val images: List<String>? = null, val toolCalls: List<ToolCall>? = null, val toolName: String? = null)

Represents a message in a chat conversation.

Link copied to clipboard
class OllamaChatBuildingStep(mokksy: MokksyServer, buildingStep: BuildingStep<ChatRequest>) : AbstractBuildingStep<ChatRequest, OllamaChatResponseSpecification>

OllamaChatBuildingStep is a specialized implementation of AbstractBuildingStep intended for constructing and managing chat completion responses as part of the Ollama Mock Server setup.

Link copied to clipboard

Specification for matching chat completion requests.

Link copied to clipboard
class OllamaChatResponseSpecification(var assistantContent: String = "This is a mock response from Ollama.", var thinking: String? = null, var toolCalls: List<Map<String, Any>>? = null, var finishReason: String? = "stop", delay: Duration = 0.seconds) : AbstractResponseSpecification<ChatRequest, ChatResponse>

Specification for configuring chat completion responses.

Link copied to clipboard
class OllamaStreamingChatResponseSpecification(responseFlow: Flow<String>? = null, responseChunks: List<String>? = null, delayBetweenChunks: Duration = 0.1.seconds, delay: Duration = 0.seconds) : AbstractStreamingResponseSpecification<ChatRequest, String, String>

Specification for configuring streaming chat completion responses.

Link copied to clipboard
data class Tool(val type: String = "function", val function: FunctionDefinition)

Represents a tool that can be used by the model.

Link copied to clipboard
data class ToolCall(val id: String, val type: String = "function", val function: FunctionCall)

Represents a tool call made by the model.