类型

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)

RagResultModel

class neo4j_graphrag.generation.types.RagResultModel(*, answer, retriever_result=None)[source]
参数:

TextChunk

class neo4j_graphrag.experimental.components.types.TextChunk(*, text, index, metadata=None)[source]

由文本拆分器从文档中拆分的文本块。

参数:
text

原始块文本。

类型:

str

index

该块在原始文档中的位置。

类型:

int

metadata

与该块相关的元数据,例如原始文档中下一个块的 ID。

类型:

Optional[dict[str, Any]]

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]

表示图中实体和关系之间的可能关系。

参数: