Skip to content

Commit

Permalink
undo some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahwooders committed Dec 17, 2024
1 parent 420a6cc commit 38c4250
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
17 changes: 10 additions & 7 deletions letta/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import traceback
import warnings
from abc import abstractmethod
from asyncio import Lock
from datetime import datetime
from typing import Callable, List, Optional, Tuple, Union

Expand Down Expand Up @@ -191,7 +190,14 @@ def db_error_handler():
config.archival_storage_uri = settings.letta_pg_uri_no_default

# create engine
engine = create_engine(settings.letta_pg_uri)
engine = create_engine(
settings.letta_pg_uri,
pool_size=settings.pg_pool_size,
max_overflow=settings.pg_max_overflow,
pool_timeout=settings.pg_pool_timeout,
pool_recycle=settings.pg_pool_recycle,
echo=settings.pg_echo,
)
else:
# TODO: don't rely on config storage
engine = create_engine("sqlite:///" + os.path.join(config.recall_storage_path, "sqlite.db"))
Expand Down Expand Up @@ -265,9 +271,6 @@ def __init__(

self.credentials = LettaCredentials.load()

# Locks
self.send_message_lock = Lock()

# Initialize the metadata store
config = LettaConfig.load()
if settings.letta_pg_uri_no_default:
Expand Down Expand Up @@ -820,7 +823,7 @@ def update_agent(
) -> AgentState:
"""Update the agents core memory block, return the new state"""
# Update agent state in the db first
self.agent_manager.update_agent(agent_id=agent_id, agent_update=request, actor=actor)
agent_state = self.agent_manager.update_agent(agent_id=agent_id, agent_update=request, actor=actor)

# Get the agent object (loaded in memory)
letta_agent = self.load_agent(agent_id=agent_id, actor=actor)
Expand All @@ -843,7 +846,7 @@ def update_agent(

letta_agent.update_state()

return letta_agent.agent_state
return agent_state

def get_tools_from_agent(self, agent_id: str, user_id: Optional[str]) -> List[Tool]:
"""Get tools from an existing agent"""
Expand Down
1 change: 1 addition & 0 deletions tests/integration_test_offline_memory_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def test_chat_only_agent(client, mock_e2b_api_key_none):
)
assert chat_only_agent is not None
assert set(chat_only_agent.memory.list_block_labels()) == {"chat_agent_persona", "chat_agent_human"}
assert len(chat_only_agent.tools) == 1

for message in ["hello", "my name is not chad, my name is swoodily"]:
client.send_message(agent_id=chat_only_agent.id, message=message, role="user")
Expand Down

0 comments on commit 38c4250

Please sign in to comment.