CodeBlock
import type { CodeBlock } from "https://googleapis.deno.dev/v1/ces:v1.ts";A code block to be executed instead of a real tool call.
interface CodeBlock {
pythonCode?: string;
}§Properties
§
pythonCode?: string
[src]Required. Python code which will be invoked in tool fake mode. Expected Python function signature - To catch all tool calls: def fake_tool_call(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]]: To catch a specific tool call: def fake_{tool_id}(tool: Tool, input: dict[str, Any], callback_context: CallbackContext) -> Optional[dict[str, Any]]: If the function returns None, the real tool will be invoked instead.