Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: patch typo, ci: disable pyright on main (#872)

Charles Packer3f877af66f5d
diff --git a/.github/workflows/pyright_types.yml b/.github/workflows/pyright_types.yml
index 786b1e874..d8a33bd6b 100644
--- a/.github/workflows/pyright_types.yml
+++ b/.github/workflows/pyright_types.yml
@@ -1,11 +1,8 @@
name: "Python Static Analysis"
on:
- push:
- branches: [ main ]
- paths: ["**.py"]
pull_request:
- branches: [ main ]
- paths: ["**.py"]
+ paths:
+ - '**.py'
permissions:
contents: read
diff --git a/memgpt/metadata.py b/memgpt/metadata.py
index c4239aabf..c19025438 100644
--- a/memgpt/metadata.py
+++ b/memgpt/metadata.py
@@ -236,13 +236,7 @@ class MetadataStore:
def create_source(self, source: Source):
# make sure source.name does not already exist for user
with self.session_maker() as session:
- if (
- self.session.query(SourceModel)
- .filter(SourceModel.name == source.name)
- .filter(SourceModel.user_id == source.user_id)
- .count()
- > 0
- ):
+ if session.query(SourceModel).filter(SourceModel.name == source.name).filter(SourceModel.user_id == source.user_id).count() > 0:
raise ValueError(f"Source with name {source.name} already exists")
session.add(SourceModel(**vars(source)))
session.commit()