Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattzh72 committed Nov 13, 2024
1 parent 6481582 commit f98f8e2
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions letta/schemas/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ class FileMetadata(FileMetadataBase):
created_at: Optional[datetime] = Field(default_factory=datetime.utcnow, description="The creation date of the file.")
updated_at: Optional[datetime] = Field(default_factory=datetime.utcnow, description="The update date of the file.")
is_deleted: bool = Field(False, description="Whether this file is deleted or not.")

class Config:
extra = "allow"
1 change: 0 additions & 1 deletion letta/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,6 @@ def attach_source_to_agent(
data_source = self.source_manager.get_source_by_name(source_name=source_name, actor=user)
else:
raise ValueError(f"Need to provide at least source_id or source_name to find the source.")

# get connection to data source storage
source_connector = StorageConnector.get_storage_connector(TableType.PASSAGES, self.config, user_id=user_id)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from letta.agent import initialize_message_sequence
from letta.client.client import LocalClient, RESTClient
from letta.constants import DEFAULT_PRESET
from letta.orm import Source
from letta.orm import FileMetadata, Source
from letta.schemas.agent import AgentState
from letta.schemas.embedding_config import EmbeddingConfig
from letta.schemas.enums import MessageRole, MessageStreamStatus
Expand Down Expand Up @@ -91,6 +91,7 @@ def clear_tables():
from letta.server.server import db_context

with db_context() as session:
session.execute(delete(FileMetadata))
session.execute(delete(Source))
session.commit()

Expand Down
3 changes: 1 addition & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def __init__(self, texts: List[str]):
def find_files(self, source) -> Iterator[FileMetadata]:
for text in self.texts:
file_metadata = FileMetadata(
user_id="",
source_id="",
source_id=source.id,
file_name="",
file_path="",
file_type="",
Expand Down

0 comments on commit f98f8e2

Please sign in to comment.