调试日志记录(Logging)插件(Plugin)
A plugin that captures complete debug information to a file.
This plugin records detailed interaction data including:
LLM requests (model, system instruction, contents, tools)
LLM responses (content, usage metadata, errors)
Function calls with arguments
Function responses with results
Events yielded from the runner
Session state at the end of each invocation
The output is written as YAML for human readability. Each invocation is appended to the file as a separate YAML document (separated by ---). Unlike LoggingPlugin, which prints truncated summaries to the console, this plugin captures the data in full.
CAUTION: The plugin writes raw requests / responses, including user prompts, tool arguments, and session state, to disk. Be mindful of sensitive data disclosure and protect the output file accordingly. An armored private key block (-----BEGIN … PRIVATE KEY-----) inside any string is replaced with <redacted>.
类型
Fluent Builder for DebugLoggingPlugin该功能主要为 Java 语言的调用者提供支持;如果某个属性未被设置,其值将默认使用构造函数中指定的默认值。
函数
当某个特定的代理完成其处理任务后,会执行相应的回调函数。
在接收到大型语言模型(LLM)的响应后,会执行该回调函数。
回调函数在 ADK 运行器完成执行后,或者调用者提前停止数据收集后(例如由于某种原因)被执行。 first() 或者 take(n))或者它的收集器抛出异常(exception)。
回调函数在某个特定代理开始处理任务之前被执行。
回调函数在向大型语言模型(LLM)发送请求之前被执行。
回调函数在 ADK 运行器开始执行主循环之前被调用。
回调函数在工具被调用之前执行。
当代理在执行过程中触发某个事件时,会执行此回调函数。
当在大型语言模型(LLM)的交互过程中发生错误时,会执行此回调函数。
当 ADK 运行器运行失败时,或者在其他特定情况下,会执行此回调函数。 afterRun 在调用者提前停止数据收集后,程序会失败(即无法继续执行)。
当工具调用过程中发生错误时,会执行此回调函数。
当在调用开始之前接收到用户消息时,会执行此回调函数。