Best docs Cinnamon will probably ever have (#105)

This commit is contained in:
ian_Cin
2023-12-20 11:30:25 +07:00
committed by GitHub
parent 0e30dcbb06
commit 230328c62f
40 changed files with 1036 additions and 46 deletions

View File

@@ -6,16 +6,16 @@ from kotaemon.base.schema import Document
class BaseComponent(Function):
"""A component is a class that can be used to compose a pipeline
"""A component is a class that can be used to compose a pipeline.
Benefits of component:
!!! tip "Benefits of component"
- Auto caching, logging
- Allow deployment
For each component, the spirit is:
!!! tip "For each component, the spirit is"
- Tolerate multiple input types, e.g. str, Document, List[str], List[Document]
- Enforce single output type. Hence, the output type of a component should be
as generic as possible.
as generic as possible.
"""
inflow = None

View File

@@ -22,6 +22,9 @@ class Document(BaseDocument):
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.
Args:
content: the raw content of the document.
"""
content: Any
@@ -99,7 +102,7 @@ class RetrievedDocument(Document):
"""Subclass of Document with retrieval-related information
Attributes:
score (float): score of the document (from 0.0 to 1.0)
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