Schema
Document ¶
Bases: Document
Base document class, mostly inherited from Document class from llama-index.
This class accept one positional argument content
of an arbitrary type, which will
store the raw content of the document. If specified, the class will use
content
to initialize the base llama_index class.
Attributes:
Name | Type | Description |
---|---|---|
content |
Any
|
raw content of the document, can be anything |
source |
Optional[str]
|
id of the source of the Document. Optional. |
channel |
Optional[Literal['chat', 'info', 'index', 'debug', 'plot']]
|
the channel to show the document. Optional.: - chat: show in chat message - info: show in information panel - index: show in index panel - debug: show in debug panel |
Source code in libs/kotaemon/kotaemon/base/schema.py
to_haystack_format ¶
Convert struct to Haystack document format.
Source code in libs/kotaemon/kotaemon/base/schema.py
DocumentWithEmbedding ¶
Bases: Document
Subclass of Document which must contains embedding
Use this if you want to enforce component's IOs to must contain embedding.
Source code in libs/kotaemon/kotaemon/base/schema.py
RetrievedDocument ¶
Bases: Document
Subclass of Document with retrieval-related information
Attributes:
Name | Type | Description |
---|---|---|
score |
float
|
score of the document (from 0.0 to 1.0) |
retrieval_metadata |
dict
|
metadata from the retrieval process, can be used by different components in a retrieved pipeline to communicate with each other |