Package-level declarations

Types

Link copied to clipboard

AIAgentContextMockBuilder is a builder class for constructing a mock implementation of an AI agent context. It provides mechanisms to configure various components of the AI agent context before constructing it. This class is intended for use in testing scenarios and extends AIAgentContextMockBuilderBase.

Link copied to clipboard

A base interface for building mock implementations of the AIAgentContextBase interface.

Link copied to clipboard
class DefaultResponseReceiver(val response: String)

Receiver class for configuring text responses from the LLM.

Link copied to clipboard
@TestOnly
class DummyAIAgentContext(builder: AIAgentContextMockBuilder, val agentId: String = "DummyAgentId") : AIAgentContextBase

A mock implementation of the AIAgentContextBase interface, used for testing purposes.

Link copied to clipboard

Simple tool implementation for testing purposes. This tool accepts a placeholder parameter and returns a constant result.

Link copied to clipboard
class MockEnvironment(toolRegistry: ToolRegistry, promptExecutor: PromptExecutor, baseEnvironment: AIAgentEnvironment? = null) : AIAgentEnvironment

A mock implementation of AIAgentEnvironment used for testing agent behavior.

Link copied to clipboard
class MockLLMBuilder(clock: Clock, tokenizer: Tokenizer? = null)

Builder class for creating mock LLM executors for testing.

Link copied to clipboard

A class that facilitates mocking of callable tools by defining their behavior based on the received arguments.

Link copied to clipboard
class ToolCondition<Args : ToolArgs, Result : ToolResult>(val tool: Tool<Args, Result>, val argsCondition: suspend (Args) -> Boolean, val produceResult: suspend (Args) -> Result)

Represents a condition for a tool call and its corresponding result.

Functions

Link copied to clipboard
fun getMockExecutor(toolRegistry: ToolRegistry? = null, clock: Clock = Clock.System, tokenizer: Tokenizer? = null, handleLastAssistantMessage: Boolean = false, init: MockLLMBuilder.() -> Unit): PromptExecutor

Creates a mock LLM executor for testing.

Link copied to clipboard

Creates a mock LLM text response.

Link copied to clipboard

Mocks a tool call for the provided tool function and arguments.

Link copied to clipboard

Associates a tool function with the MockLLMBuilder to create a MockToolFromCallableReceiver instance.