Package-level declarations

Types

Link copied to clipboard
class DummyAgent(name: String = "test-agent", subAgents: List<BaseAgent> = emptyList(), beforeAgentCallbacks: List<BeforeAgentCallback> = emptyList(), afterAgentCallbacks: List<AfterAgentCallback> = emptyList(), description: String = "", disallowTransferToParent: Boolean = false, disallowTransferToPeers: Boolean = false, val onRunAsync: suspend FlowCollector<Event>.(InvocationContext) -> Unit = {}) : BaseAgent

A configurable dummy implementation of BaseAgent designed for unit testing.

Functions

Link copied to clipboard
fun modelFunctionCall(name: String, args: Map<String, Any?> = emptyMap(), id: String? = null): Content

A model-role Content carrying a single FunctionCall.

Link copied to clipboard
fun modelFunctionCallResponse(name: String, args: Map<String, Any?> = emptyMap(), id: String? = null): LlmResponse

A model response containing a single FunctionCall part.

Link copied to clipboard

A model-role text Content (the typical model response body).

fun modelMessage(part: Part, vararg moreParts: Part): Content

The model-role counterpart of the parts overload of userMessage.

Link copied to clipboard

A model response containing several FunctionCall parts in a single turn.

Link copied to clipboard
fun testInvocationContext(agent: BaseAgent = DummyAgent(), session: Session = testSession(), runConfig: RunConfig? = RunConfig(), invocationId: String = "test-invocation-id", branch: String? = null, sessionService: SessionService? = null, artifactService: ArtifactService? = null, memoryService: MemoryService? = null, resumabilityConfig: ResumabilityConfig? = null, userContent: Content? = null): InvocationContext

An InvocationContext populated with sensible defaults for tests.

Link copied to clipboard
fun testSession(appName: String = "test_app_name", userId: String = "test_user_id", id: String? = "test_session_id"): Session

A Session with a SessionKey and otherwise default state and event list.

Link copied to clipboard
fun testToolContext(invocationContext: InvocationContext = testInvocationContext(), actions: EventActions = EventActions(), functionCallId: String? = null, eventId: String? = null, toolConfirmation: ToolConfirmation? = null): ToolContext
Link copied to clipboard
fun userFunctionResponse(name: String, id: String?, response: Map<String, Any?> = emptyMap()): Content

A user-role Content carrying a single FunctionResponse - what the caller sends back when resuming after a long-running tool, an HITL approval, or a manual function-response injection.

Link copied to clipboard

A user-role text Content (the typical user message).

fun userMessage(part: Part, vararg moreParts: Part): Content

A user-role Content of one or more parts.