Skip to content

Commit

Permalink
Fix spell
Browse files Browse the repository at this point in the history
  • Loading branch information
pprados committed Nov 23, 2023
1 parent abe534f commit a9e342a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/langchain/langchain/indexes/memory_recordmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class MemoryRecordManager(RecordManager):
datas: List[Dict[str, Any]] = []
data: List[Dict[str, Any]] = []

def __init__(self, namespace: str):
super().__init__(namespace=namespace)
Expand Down Expand Up @@ -49,11 +49,11 @@ def update(
for key, group_id in zip(keys, group_ids)
]
self.delete_keys(keys)
self.datas.extend(records_to_upsert)
self.data.extend(records_to_upsert)

def exists(self, keys: Sequence[str]) -> List[bool]:
return [
len(list(filter(lambda record: record["key"] == key, self.datas))) == 1
len(list(filter(lambda record: record["key"] == key, self.data))) == 1
for key in keys
]

Expand All @@ -72,17 +72,17 @@ def list_keys(
and (not group_ids or record["group_id"] in group_ids)
and (not before or record["updated_at"] < before)
and (not after or record["updated_at"] > after),
self.datas,
self.data,
)
]
return keys[:limit]

def delete_keys(self, keys: Sequence[str]) -> None:
self.datas = list(
self.data = list(
filter(
lambda record: record["namespace"] != self.namespace
or record["key"] not in keys,
self.datas,
self.data,
)
)

Expand Down

0 comments on commit a9e342a

Please sign in to comment.