corpus
Agent corpus reader module.
This client module reads a corpus file and calls the backend API to create memories. Effectively this builds a memory collection by “reading” the corpus into new memories.
Attributes
Classes
ChunkProcessingException
Bases: Exception
Exception raised when a chunk processing error occurs
Attributes
Functions
Corpus
Bases: BaseCLI
EleanorAI Framework corpus reader
CLI base class
Warning
An odd behavior with Fire has been observed where subclasses of BaseCLI
take override __init__
and take parameters caus Fire to incorrectly
identify self
as a required CLI argument.
Parameters:
-
config
(str
, default:None
) –Path to configuration file
Functions
read
read(
corpus: str,
collection: str,
session: str,
namespace: str | None = None,
user: str | None = None,
agent: str | None = None,
truncate: bool = False,
resume: int = 0,
)
Reads a corpus file and create memories in the Eleanor framework
Parameters:
-
corpus
(str
) –The path to the corpus file.
-
collection
(str
) –The name of the collection, will be created if it doesn’t exist
-
session
(str
) –The name of the session, will be created if it doesn’t exist
-
namespace
(str
, default:None
) –The namespace to use, when None the framework default namespace will be used.
-
user
(str
, default:None
) –Override the configured reader user, not recommended in most circumstances
-
agent
(str
, default:None
) –Override the reader agent, not recommended in most circumstances
-
truncate
(bool
, default:False
) –Whether to truncate (delete) all existing data in the memory collection before performing read operation.
-
resume
(int
, default:0
) –The chunk index to resume from, when None the operation will start from the beginning.
Returns:
-
–
None