Event types
BaseEvent #
Bases: BaseModel
Source code in llama_index/core/instrumentation/events/base.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
class_name
classmethod
#
class_name()
返回类名。
Source code in llama_index/core/instrumentation/events/base.py
12 13 14 15 |
|
AgentChatWithStepEndEvent #
Bases: BaseEvent
AgentChatWithStepEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response |
Optional[AGENT_CHAT_RESPONSE_TYPE]
|
代理人聊天响应。 |
required |
Source code in llama_index/core/instrumentation/events/agent.py
60 61 62 63 64 65 66 67 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 |
|
validate_response #
validate_response(values: Any) -> Any
验证响应。
Source code in llama_index/core/instrumentation/events/agent.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
validate_response_type #
validate_response_type(response: Any) -> Any
验证响应类型。
Source code in llama_index/core/instrumentation/events/agent.py
83 84 85 86 87 88 89 90 91 92 93 94 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/agent.py
96 97 98 99 |
|
AgentChatWithStepStartEvent #
Bases: BaseEvent
AgentChatWithStepStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
user_msg |
str
|
用户输入消息。 |
required |
Source code in llama_index/core/instrumentation/events/agent.py
46 47 48 49 50 51 52 53 54 55 56 57 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/agent.py
54 55 56 57 |
|
AgentRunStepEndEvent #
Bases: BaseEvent
AgentRunStepEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
step_output |
TaskStepOutput
|
任务步骤输出。 |
required |
Source code in llama_index/core/instrumentation/events/agent.py
32 33 34 35 36 37 38 39 40 41 42 43 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/agent.py
40 41 42 43 |
|
AgentRunStepStartEvent #
Bases: BaseEvent
AgentRunStepStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_id |
str
|
任务ID。 |
required |
step |
Optional[TaskStep]
|
任务步骤。 |
required |
input |
Optional[str]
|
可选输入。 |
required |
Source code in llama_index/core/instrumentation/events/agent.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/agent.py
26 27 28 29 |
|
AgentToolCallEvent #
Bases: BaseEvent
AgentToolCallEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arguments |
str
|
参数。 |
required |
tool |
ToolMetadata
|
工具元数据。 |
required |
Source code in llama_index/core/instrumentation/events/agent.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/agent.py
112 113 114 115 |
|
StreamChatDeltaReceivedEvent #
Bases: BaseEvent
StreamChatDeltaReceivedEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
delta |
str
|
从流聊天中接收到的Delta。 |
required |
Source code in llama_index/core/instrumentation/events/chat_engine.py
42 43 44 45 46 47 48 49 50 51 52 53 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/chat_engine.py
50 51 52 53 |
|
StreamChatEndEvent #
Bases: BaseEvent
StreamChatEndEvent。
在写入流聊天引擎队列结束时触发。
Source code in llama_index/core/instrumentation/events/chat_engine.py
15 16 17 18 19 20 21 22 23 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/chat_engine.py
20 21 22 23 |
|
StreamChatErrorEvent #
Bases: BaseEvent
StreamChatErrorEvent。
在流聊天引擎操作期间引发异常时触发。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
exception |
Exception
|
在流聊天操作期间引发的异常。 |
required |
Source code in llama_index/core/instrumentation/events/chat_engine.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/chat_engine.py
36 37 38 39 |
|
StreamChatStartEvent #
Bases: BaseEvent
StreamChatStartEvent。
在开始写入流聊天引擎队列时触发。
Source code in llama_index/core/instrumentation/events/chat_engine.py
4 5 6 7 8 9 10 11 12 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/chat_engine.py
9 10 11 12 |
|
EmbeddingEndEvent #
Bases: BaseEvent
EmbeddingEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
chunks |
List[str]
|
切块的列表。 |
required |
embeddings |
List[List[float]]
|
嵌入的列表。 |
required |
Source code in llama_index/core/instrumentation/events/embedding.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/embedding.py
30 31 32 33 |
|
EmbeddingStartEvent #
Bases: BaseEvent
EmbeddingStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_dict |
dict
|
包含嵌入模型详情的模型字典。 |
required |
Source code in llama_index/core/instrumentation/events/embedding.py
6 7 8 9 10 11 12 13 14 15 16 17 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/embedding.py
14 15 16 17 |
|
LLMChatEndEvent #
Bases: BaseEvent
LLMChatEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
messages |
List[ChatMessage]
|
聊天消息列表。 |
required |
response |
Optional[ChatResponse]
|
最后的聊天回复。 |
required |
Source code in llama_index/core/instrumentation/events/llm.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/llm.py
154 155 156 157 |
|
LLMChatStartEvent #
Bases: BaseEvent
LLMChatStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
messages |
List[ChatMessage]
|
聊天消息列表。 |
required |
additional_kwargs |
dict
|
附加的关键字参数。 |
required |
model_dict |
dict
|
模型字典。 |
required |
Source code in llama_index/core/instrumentation/events/llm.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/llm.py
122 123 124 125 |
|
LLMCompletionEndEvent #
Bases: BaseEvent
LLMCompletionEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt |
str
|
待完成的提示。 |
required |
response |
CompletionResponse
|
完成响应。 |
required |
Source code in llama_index/core/instrumentation/events/llm.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/llm.py
104 105 106 107 |
|
LLMCompletionStartEvent #
Bases: BaseEvent
LLMCompletionStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prompt |
str
|
待完成的提示。 |
required |
additional_kwargs |
dict
|
附加的关键字参数。 |
required |
model_dict |
dict
|
模型字典。 |
required |
Source code in llama_index/core/instrumentation/events/llm.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/llm.py
88 89 90 91 |
|
LLMPredictEndEvent #
Bases: BaseEvent
LLMPredictEndEvent.
llm.predict()调用的结果。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
output |
str
|
输出。 |
required |
Source code in llama_index/core/instrumentation/events/llm.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/llm.py
38 39 40 41 |
|
LLMPredictStartEvent #
Bases: BaseEvent
LLMPredictStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
template |
BasePromptTemplate
|
提示模板。 |
required |
template_args |
Optional[dict]
|
提示模板参数。 |
required |
Source code in llama_index/core/instrumentation/events/llm.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/llm.py
22 23 24 25 |
|
QueryEndEvent #
Bases: BaseEvent
QueryEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
QueryType
|
字符串形式的查询或查询包。 |
required |
response |
RESPONSE_TYPE
|
响应。 |
required |
Source code in llama_index/core/instrumentation/events/query.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/query.py
30 31 32 33 |
|
QueryStartEvent #
Bases: BaseEvent
QueryStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
QueryType
|
查询作为字符串或查询包。 |
required |
Source code in llama_index/core/instrumentation/events/query.py
6 7 8 9 10 11 12 13 14 15 16 17 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/query.py
14 15 16 17 |
|
RetrievalEndEvent #
Bases: BaseEvent
RetrievalEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
str_or_query_bundle |
QueryType
|
查询包。 |
required |
nodes |
List[NodeWithScore]
|
带有分数的节点列表。 |
required |
Source code in llama_index/core/instrumentation/events/retrieval.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/retrieval.py
30 31 32 33 |
|
RetrievalStartEvent #
Bases: BaseEvent
RetrievalStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
str_or_query_bundle |
QueryType
|
查询包。 |
required |
Source code in llama_index/core/instrumentation/events/retrieval.py
6 7 8 9 10 11 12 13 14 15 16 17 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/retrieval.py
14 15 16 17 |
|
GetResponseEndEvent #
Bases: BaseEvent
获取响应结束事件。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
str
|
查询字符串。 |
required |
response |
RESPONSE_TEXT_TYPE
|
响应。 |
required |
Source code in llama_index/core/instrumentation/events/synthesis.py
55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/synthesis.py
64 65 66 67 |
|
GetResponseStartEvent #
Bases: BaseEvent
获取响应开始事件。
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query_str |
str
|
查询字符串。 |
required |
text_chunks |
List[str]
|
文本块列表。 |
required |
Source code in llama_index/core/instrumentation/events/synthesis.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/synthesis.py
49 50 51 52 |
|
SynthesizeEndEvent #
Bases: BaseEvent
SynthesizeEndEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
QueryType
|
字符串形式的查询或查询包。 |
required |
response |
RESPONSE_TYPE
|
响应。 |
required |
Source code in llama_index/core/instrumentation/events/synthesis.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/synthesis.py
33 34 35 36 |
|
SynthesizeStartEvent #
Bases: BaseEvent
SynthesizeStartEvent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
QueryType
|
字符串形式的查询或查询包。 |
required |
Source code in llama_index/core/instrumentation/events/synthesis.py
9 10 11 12 13 14 15 16 17 18 19 20 |
|
class_name
classmethod
#
class_name()
类名。
Source code in llama_index/core/instrumentation/events/synthesis.py
17 18 19 20 |
|