Package core.rag
class Document
func operator !=
public operator func !=(other: Document):Bool
func operator ==
public operator func ==(other: Document):Bool
let content
public let content: String
func deserialize
public static func deserialize(dm: DataModel)
func fromJsonValue
public static func fromJsonValue(json: JsonValue): Document
func getTypeSchema
public static func getTypeSchema(): TypeSchema
let id
public let id: String
func init
public init(content: String, metadata!: HashMap<String, String> = HashMap())
- 描述: 根据内容和元数据初始化文档
- 参数:
content: String, 文档的内容
metadata: HashMap<String, String>, 文档的元数据,默认为空
func init
public init(id: String, content: String, metadata!: HashMap<String, String>)
- 描述: 根据ID、内容和元数据初始化文档
- 参数:
id: String, 文档的唯一标识符
content: String, 文档的内容
metadata: HashMap<String, String>, 文档的元数据
public let metadata: HashMap<String, String>
func serialize
public func serialize(): DataModel
func toJsonString
public func toJsonString(): String
func toJsonValue
public func toJsonValue(): JsonValue
func toPrompt
public override func toPrompt(): String
func toString
public override func toString(): String
interface Retrieval
prop sources
prop sources: Array<Document>
struct RetrievalInfo
interface Retriever
prop description
prop description: String
- 描述: 描述检索器将搜索的内容。在动态模式下使用。
prop mode
mut prop mode: RetrieverMode
func search
func search(query: String): Retrieval
class RetrieverException
func init
init(msg: String)
- 描述: 构造函数,用于创建RetrieverException实例
- 参数:
enum RetrieverMode
func operator !=
operator func !=(other: RetrieverMode): Bool
- 描述: 比较两个RetrieverMode是否不相等
- 参数:
other: RetrieverMode, 要比较的另一个RetrieverMode实例
func operator ==
operator func ==(other: RetrieverMode): Bool
- 描述: 比较两个RetrieverMode是否相等
- 参数:
other: RetrieverMode, 要比较的另一个RetrieverMode实例
Dynamic
Dynamic
Static
Static