类型
RawSearchResult
-
class neo4j_graphrag.types.RawSearchResult(*, records, metadata=None)[source]
表示从检索器 get_search_result 方法返回的原始结果。在作为 RetrieverResult 返回之前,它需要进一步格式化。
- 参数:
-
-
records
来自 Neo4j 的记录列表。
- 类型:
list[neo4j.Record]
-
metadata
与记录相关的元数据,例如分数。
- 类型:
dict[str, Any] | None
RetrieverResult
-
class neo4j_graphrag.types.RetrieverResult(*, items, metadata=None)[source]
表示从检索器返回的结果。
- 参数:
-
-
items
检索到的项目列表。
- 类型:
list[RetrieverResultItem]
-
metadata
与上下文相关的元数据,例如 Text2CypherRetriever 中生成的 Cypher 查询。
- 类型:
dict[str, Any] | None
RetrieverResultItem
-
class neo4j_graphrag.types.RetrieverResultItem(*, content, metadata=None)[source]
从检索器返回的单条记录。
- 参数:
-
-
content
将提供给 LLM 的上下文
- 类型:
str
-
metadata
可随文本一起包含的任何元数据,与该记录相关(例如,另一个节点属性)
- 类型:
Optional[dict]
LLMResponse
-
class neo4j_graphrag.llm.types.LLMResponse(*, content)[source]
- 参数:
content (str)
LLMMessage
-
class neo4j_graphrag.types.LLMMessage[source]
RagResultModel
-
class neo4j_graphrag.generation.types.RagResultModel(*, answer, retriever_result=None)[source]
- 参数:
-
DocumentInfo
-
class neo4j_graphrag.experimental.components.types.DocumentInfo(*, path, metadata=None, uid=<factory>)[source]
由 DataLoader 加载的文档。
- 参数:
-
-
path
文档路径。
- 类型:
str
-
metadata
与此文档关联的元数据。
- 类型:
Optional[dict[str, Any]]
-
uid
此文档的唯一标识符。
- 类型:
str
TextChunk
-
class neo4j_graphrag.experimental.components.types.TextChunk(text, index, metadata=None, uid=<factory>)[source]
由文本分割器从文档中分割出的一段文本块。
- 参数:
-
-
text
原始文本块。
- 类型:
str
-
index
此文本块在原始文档中的位置。
- 类型:
int
-
metadata
与此文本块关联的元数据。
- 类型:
Optional[dict[str, Any]]
-
uid
此文本块的唯一标识符。
- 类型:
str
TextChunks
-
class neo4j_graphrag.experimental.components.types.TextChunks(*, chunks)[source]
由文本分割器返回的文本块集合。
- 参数:
chunks (list[TextChunk])
-
chunks
文本块列表。
- 类型:
list[TextChunk]
Neo4jNode
-
class neo4j_graphrag.experimental.components.types.Neo4jNode(*, id, label, properties={}, embedding_properties=None)[source]
表示 Neo4j 节点。
- 参数:
-
-
id
节点的元素 ID。
- 类型:
str
-
label
节点的标签。
- 类型:
str
-
properties
附着在节点上的属性字典。
- 类型:
dict[str, Any]
-
embedding_properties
附着在节点上的嵌入属性列表。
- 类型:
Optional[dict[str, list[float]]]
Neo4jRelationship
-
class neo4j_graphrag.experimental.components.types.Neo4jRelationship(*, start_node_id, end_node_id, type, properties={}, embedding_properties=None)[source]
表示 Neo4j 关系。
- 参数:
-
-
start_node_id
起始节点的 ID。
- 类型:
str
-
end_node_id
结束节点的 ID。
- 类型:
str
-
type
关系类型。
- 类型:
str
-
properties
附着在关系上的属性字典。
- 类型:
dict[str, Any]
-
embedding_properties
附着在关系上的嵌入属性列表。
- 类型:
Optional[dict[str, list[float]]]
Neo4jGraph
-
class neo4j_graphrag.experimental.components.types.Neo4jGraph(*, nodes=[], relationships=[])[source]
表示 Neo4j 图。
- 参数:
-
-
nodes
图中的节点列表。
- 类型:
list[Neo4jNode]
-
relationships
图中的关系列表。
- 类型:
list[Neo4jRelationship]
KGWriterModel
-
class neo4j_graphrag.experimental.components.kg_writer.KGWriterModel(*, status, metadata=None)[source]
知识图谱写入器的输出数据模型。
- 参数:
-
-
status
写入操作是否成功。
- 类型:
Literal[“SUCCESS”, “FAILURE”]
SchemaProperty
-
class neo4j_graphrag.experimental.components.schema.SchemaProperty(*, name, type, description='')[source]
表示图中节点或关系上的属性。
- 参数:
name (str)
type (Literal['BOOLEAN', 'DATE', 'DURATION', 'FLOAT', 'INTEGER', 'LIST', 'LOCAL_DATETIME', 'LOCAL_TIME', 'POINT', 'STRING', 'ZONED_DATETIME', 'ZONED_TIME'])
description (str)
SchemaEntity
-
class neo4j_graphrag.experimental.components.schema.SchemaEntity(*, label, description='', properties=[])[source]
表示图中可能存在的节点。
- 参数:
-
SchemaRelation
-
class neo4j_graphrag.experimental.components.schema.SchemaRelation(*, label, description='', properties=[])[source]
表示图中节点之间可能的关系。
- 参数:
-
SchemaConfig
-
class neo4j_graphrag.experimental.components.schema.SchemaConfig(*, entities, relations, potential_schema)[source]
表示图中实体和关系之间可能的关系。
- 参数:
-
LexicalGraphConfig
-
class neo4j_graphrag.experimental.components.types.LexicalGraphConfig(*, id_prefix='', document_node_label='Document', chunk_node_label='Chunk', chunk_to_document_relationship_type='FROM_DOCUMENT', next_chunk_relationship_type='NEXT_CHUNK', node_to_chunk_relationship_type='FROM_CHUNK', chunk_id_property='id', chunk_index_property='index', chunk_text_property='text', chunk_embedding_property='embedding')[source]
配置词汇图中的所有标签和属性名称。
- 参数:
id_prefix (str)
document_node_label (str)
chunk_node_label (str)
chunk_to_document_relationship_type (str)
next_chunk_relationship_type (str)
node_to_chunk_relationship_type (str)
chunk_id_property (str)
chunk_index_property (str)
chunk_text_property (str)
chunk_embedding_property (str)
Neo4jDriverType
-
class neo4j_graphrag.experimental.pipeline.config.object_config.Neo4jDriverType(root=PydanticUndefined)[source]
一个用于封装 neo4j.Driver 和 Neo4jDriverConfig 对象的模型。
parse
方法总是返回一个 neo4j.Driver。
- 参数:
root (Driver | Neo4jDriverConfig)
Neo4jDriverConfig
-
class neo4j_graphrag.experimental.pipeline.config.object_config.Neo4jDriverConfig(*, class_=None, params_={})[source]
- 参数:
-
LLMType
-
class neo4j_graphrag.experimental.pipeline.config.object_config.LLMType(root=PydanticUndefined)[source]
一个用于封装 LLMInterface 和 LLMConfig 对象的模型。
parse
方法总是返回一个继承自 LLMInterface 的对象。
- 参数:
root (LLMInterface | LLMConfig)
LLMConfig
-
class neo4j_graphrag.experimental.pipeline.config.object_config.LLMConfig(*, class_=None, params_={})[source]
任何 LLMInterface 对象的配置。
默认情况下,将尝试从 neo4j_graphrag.llm
导入。
- 参数:
-
EmbedderType
-
class neo4j_graphrag.experimental.pipeline.config.object_config.EmbedderType(root=PydanticUndefined)[source]
一个用于封装 Embedder 和 EmbedderConfig 对象的模型。
parse
方法总是返回一个继承自 Embedder 的对象。
- 参数:
root (Embedder | EmbedderConfig)
EmbedderConfig
-
class neo4j_graphrag.experimental.pipeline.config.object_config.EmbedderConfig(*, class_=None, params_={})[source]
任何 Embedder 对象的配置。
默认情况下,将尝试从 neo4j_graphrag.embeddings
导入。
- 参数:
-
ComponentType
-
class neo4j_graphrag.experimental.pipeline.config.object_config.ComponentType(root=PydanticUndefined)[source]
- 参数:
root (Component | ComponentConfig)
ComponentConfig
-
class neo4j_graphrag.experimental.pipeline.config.object_config.ComponentConfig(*, class_=None, params_={}, run_params_={})[source]
所有组件的配置模型。
除了对象配置,组件还可以有预定义参数,这些参数将传递给 run
方法,即 run_params_
。
- 参数:
-
ParamFromEnvConfig
-
class neo4j_graphrag.experimental.pipeline.config.param_resolver.ParamFromEnvConfig(*, resolver_=ParamResolverEnum.ENV, var_)[source]
- 参数:
-
EventType
-
enum neo4j_graphrag.experimental.pipeline.notification.EventType(value)[source]
有效值如下
-
PIPELINE_STARTED = <EventType.PIPELINE_STARTED: 'PIPELINE_STARTED'>
-
TASK_STARTED = <EventType.TASK_STARTED: 'TASK_STARTED'>
-
TASK_PROGRESS = <EventType.TASK_PROGRESS: 'TASK_PROGRESS'>
-
TASK_FINISHED = <EventType.TASK_FINISHED: 'TASK_FINISHED'>
-
PIPELINE_FINISHED = <EventType.PIPELINE_FINISHED: 'PIPELINE_FINISHED'>
-
PIPELINE_FAILED = <EventType.PIPELINE_FAILED: 'PIPELINE_FAILED'>
PipelineEvent
-
class neo4j_graphrag.experimental.pipeline.notification.PipelineEvent(*, event_type, run_id, timestamp=<factory>, message=None, payload=None)[source]
- 参数:
-
TaskEvent
-
class neo4j_graphrag.experimental.pipeline.notification.TaskEvent(*, event_type, run_id, timestamp=<factory>, message=None, payload=None, task_name)[source]
- 参数:
-
EventCallbackProtocol
-
class neo4j_graphrag.experimental.pipeline.notification.EventCallbackProtocol(*args, **kwargs)[source]
此协议用于从流水线本身发送有关流水线进度的事件。它将根据事件类型接收 PipelineEvent 或 TaskEvent。
-
__call__(event)[source]
将自身作为函数调用。
- 参数:
event (Event)
- 返回类型:
Awaitable[None]
TaskProgressCallbackProtocol
-
class neo4j_graphrag.experimental.pipeline.types.context.TaskProgressNotifierProtocol(*args, **kwargs)[source]
此协议用于将事件从组件发送到流水线回调协议。发送到回调的事件类型将是 TaskEvent,其 event_type=TASK_PROGRESS
。
-
__call__(message, data)[source]
将自身作为函数调用。
- 参数:
-
- 返回类型:
Awaitable[None]
RunContext
-
class neo4j_graphrag.experimental.pipeline.types.context.RunContext(*, run_id, task_name, notifier=None)[source]
传递给组件的上下文
- 参数:
-
© . This site is unofficial and not affiliated with Neo4j, Inc.