事件类型
基类:EventBaseModel
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
timestamp
|
datetime
|
|
datetime.datetime(2025, 11, 28, 15, 32, 38, 103099)
|
id_
|
str
|
|
'059f2bb5-e42c-4668-8590-763c735b7a52'
|
tags
|
Dict[str, Any]
|
|
{}
|
workflows/handler.py 中的源代码llama_index_instrumentation/base/event.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
class_name
classmethod
#
class_name() -> str
返回类名。
workflows/handler.py 中的源代码llama_index_instrumentation/base/event.py
20 21 22 23 | |
字典 #
dict(**kwargs: Any) -> Dict[str, Any]
保留以保持向后兼容性。
workflows/handler.py 中的源代码llama_index_instrumentation/base/event.py
25 26 27 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
智能体聊天与步骤结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
response
|
Optional[AGENT_CHAT_RESPONSE_TYPE]
|
智能体聊天回复。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
validate_response
classmethod
#
validate_response(values: Any) -> Any
验证响应。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
validate_response_type
classmethod
#
validate_response_type(response: Any) -> Any
验证响应类型。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
95 96 97 98 99 100 101 102 103 104 105 106 107 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
109 110 111 112 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
智能体聊天步骤开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
user_msg
|
str
|
用户输入消息。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
62 63 64 65 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
智能体运行步骤结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
step_output
|
Any
|
任务步骤输出。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
45 46 47 48 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
智能体运行步骤开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
task_id
|
str
|
任务ID。 |
required |
step
|
Optional[Any]
|
任务步骤。 |
required |
input
|
Optional[str]
|
可选输入。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
28 29 30 31 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
智能体工具调用事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
arguments
|
str
|
参数。 |
required |
tool
|
ToolMetadata
|
工具元数据。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/agent.py
128 129 130 131 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
流式聊天增量接收事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
delta
|
str
|
从流式聊天接收到的增量数据。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
60 61 62 63 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
流式聊天结束事件。
在写入流式聊天引擎队列结束时触发。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
17 18 19 20 21 22 23 24 25 26 27 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
24 25 26 27 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
StreamChatErrorEvent。
当在流式聊天引擎操作期间引发异常时触发。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
exception
|
Exception
|
在流式聊天操作期间引发的异常。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
43 44 45 46 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
流式聊天开始事件。
在开始写入流式聊天引擎队列时触发。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
4 5 6 7 8 9 10 11 12 13 14 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/chat_engine.py
11 12 13 14 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
嵌入结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
chunks
|
List[str]
|
分块列表。 |
required |
embeddings
|
List[List[float]]
|
嵌入向量列表。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/embedding.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/embedding.py
38 39 40 41 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
嵌入开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
model_dict
|
dict
|
包含嵌入模型详细信息的模型字典。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/embedding.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/embedding.py
19 20 21 22 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
LLM聊天结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
messages
|
List[ChatMessage]
|
聊天消息列表。 |
required |
response
|
Optional[ChatResponse]
|
上一次聊天回复。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
237 238 239 240 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
LLM聊天启动事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
messages
|
List[ChatMessage]
|
聊天消息列表。 |
required |
additional_kwargs
|
dict
|
额外的关键字参数。 |
required |
model_dict
|
dict
|
模型字典。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
193 194 195 196 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
LLM完成结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
prompt
|
str
|
待完成的提示词。 |
required |
response
|
CompletionResponse
|
完成响应。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
165 166 167 168 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
LLM完成开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
prompt
|
str
|
待完成的提示词。 |
required |
additional_kwargs
|
dict
|
额外的关键字参数。 |
required |
model_dict
|
dict
|
模型字典。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
121 122 123 124 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
LLM预测结束事件。
llm.predict() 调用的结果。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
output
|
str
|
输出。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
44 45 46 47 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
LLM预测开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
template
|
BasePromptTemplate
|
提示模板。 |
required |
template_args
|
Optional[dict]
|
提示模板参数。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/llm.py
25 26 27 28 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
查询结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query
|
QueryType
|
查询字符串或查询包。 |
required |
response
|
RESPONSE_TYPE
|
响应。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/query.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/query.py
36 37 38 39 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
查询开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query
|
QueryType
|
查询字符串或查询包。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/query.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/query.py
17 18 19 20 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
检索结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
str_or_query_bundle
|
QueryType
|
查询捆绑包。 |
required |
nodes
|
List[NodeWithScore]
|
带分数的节点列表。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/retrieval.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/retrieval.py
36 37 38 39 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
检索开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
str_or_query_bundle
|
QueryType
|
查询捆绑包。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/retrieval.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/retrieval.py
17 18 19 20 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
获取响应结束事件。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
63 64 65 66 67 68 69 70 71 72 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
69 70 71 72 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
获取响应开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query_str
|
str
|
查询字符串。 |
required |
text_chunks
|
List[str]
|
文本块列表。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
57 58 59 60 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
合成结束事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query
|
QueryType
|
查询字符串或查询包。 |
required |
response
|
RESPONSE_TYPE
|
响应。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
38 39 40 41 | |
选项: 显示根目录标题:是 显示根目录完整路径:否
基类:EventBaseEvent
合成开始事件。
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
query
|
QueryType
|
查询字符串或查询包。 |
required |
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
class_name
classmethod
#
class_name() -> str
类名。
workflows/handler.py 中的源代码llama_index/core/instrumentation/events/synthesis.py
19 20 21 22 | |
选项: 显示根目录标题:是 显示根目录完整路径:否