Skip to content

Commit

Permalink
fix type in StrayCat.user_data
Browse files Browse the repository at this point in the history
  • Loading branch information
pieroit committed Nov 1, 2024
1 parent b04bcfa commit 38fff84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/cat/looking_glass/stray_cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from cat.memory.working_memory import WorkingMemory
from cat.convo.messages import CatMessage, UserMessage, MessageWhy, Role, EmbedderModelInteraction
from cat.agents import AgentOutput
from cat.auth.permissions import AuthUserInfo
from cat import utils
from websockets.exceptions import ConnectionClosedOK

Expand All @@ -32,7 +33,7 @@ def __init__(
self,
user_id: str,
main_loop,
user_data: dict = {},
user_data: AuthUserInfo = None,
ws: WebSocket = None,
):
self.__user_id = user_id
Expand Down
2 changes: 2 additions & 0 deletions core/tests/routes/test_session.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

from cat.looking_glass.stray_cat import StrayCat
from cat.auth.permissions import AuthUserInfo

from tests.utils import send_websocket_message

Expand All @@ -18,6 +19,7 @@ def test_session_creation_from_websocket(client):
assert isinstance(strays["Alice"], StrayCat)
assert strays["Alice"].user_id == "Alice"
assert hasattr(strays["Alice"], "user_data")
assert isinstance(strays["Alice"].user_data, AuthUserInfo)
assert strays["Alice"].user_data.id == "Alice"
convo = strays["Alice"].working_memory.history
assert len(convo) == 2
Expand Down

0 comments on commit 38fff84

Please sign in to comment.