mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-27 02:44:22 +01:00
Add docstring to function get_memory() in autogpt.memory.vector (#1296)
* Document function get_memory in ./scripts/memory/init.py * Update get_memory docstring to current format --------- Co-authored-by: Reinier van der Leer <github@pwuts.nl>
This commit is contained in:
@@ -40,6 +40,21 @@ supported_memory = ["json_file", "no_memory"]
|
||||
|
||||
|
||||
def get_memory(config: Config) -> VectorMemory:
|
||||
"""Returns a memory object corresponding to the memory backend specified in the config.
|
||||
|
||||
The type of memory object returned depends on the value of the `memory_backend`
|
||||
attribute in the configuration. E.g. if `memory_backend` is set to "pinecone", a
|
||||
`PineconeMemory` object is returned. If it is set to "redis", a `RedisMemory`
|
||||
object is returned.
|
||||
By default, a `JSONFileMemory` object is returned.
|
||||
|
||||
Params:
|
||||
config: A configuration object that contains information about the memory backend
|
||||
to be used and other relevant parameters.
|
||||
|
||||
Returns:
|
||||
VectorMemory: an instance of a memory object based on the configuration provided.
|
||||
"""
|
||||
memory = None
|
||||
|
||||
match config.memory_backend:
|
||||
|
||||
Reference in New Issue
Block a user