包级(Package-level) 声明(declarations)

类型

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

一个可配置的、用于演示目的的虚拟实现(dummy implementation); BaseAgent 专为单元测试而设计。

Link copied to clipboard

一个假货;一个伪造品。 LiveConnection 那个可以运行的程序/系统…… 步骤(steps) 它会按顺序存储并记录所有发送给它的消息。

Link copied to clipboard
class DummyLiveModel @JvmOverloads constructor(steps: List<DummyLiveStep>, val name: String = "dummy-live-model") : Model

一场虚假的“直播” 模型 用于测试那些没有网络连接的在线客服人员(即“live agents”)以及相关系统组件(即“runners”)。

Link copied to clipboard

其中一个需要通过脚本来执行的步骤是: DummyLiveConnection 在以下情况下运行: receive() 这些数据被收集了起来。

Link copied to clipboard
class DummyTool(name: String = "dummy_tool", description: String = "A dummy tool for testing.", isLongRunning: Boolean = false, declares: Boolean = false, val onRun: suspend (context: ToolContext, args: Map<String, Any?>) -> Any = { _, _ -> mapOf("status" to "done") }) : BaseTool

一个高度可配置的虚拟实现(dummy implementation)…… BaseTool 仅用于测试目的。

函数

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

A model-role 内容 携带一个(物品) FunctionCall.

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

一个模型响应,其中包含一个项目(或数据项)。 FunctionCall part.

Link copied to clipboard

A model-role text 内容 (典型的模型响应体。)

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

该模型与角色的对应关系,与“parts overload”(即“部分的重载”)的概念相关。 userMessage.

Link copied to clipboard

一个模型响应,其中包含多个内容…… FunctionCall 在一次操作中完成多个步骤(或任务)。

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 这些测试用例中预先设置了合理的默认值(即“sensible defaults”)。

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 以及其他默认状态和事件列表。

Link copied to clipboard
fun testToolContext(invocationContext: InvocationContext = testInvocationContext(), actions: EventActions = EventActions(), functionCallId: String? = null, eventId: String? = null, toolConfirmation: ToolConfirmation? = null): ToolContext

A ToolContext 将……包裹起来;用……覆盖…… InvocationContext 由……开发/构建 `testInvocationContext`.

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

A user-role 内容 携带一个(物品) FunctionResponse - 当调用者在长时间运行的工具、HITL审批过程或手动函数响应注入完成后重新恢复执行时,会发送回什么数据。

Link copied to clipboard

A user-role text 内容 (典型的用户消息。)

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

A user-role 内容 由一个或多个部分组成。