Skip to content

Commit ab48675

Browse files
committed
refactor: improve logging messages for processed and processing sessions
1 parent e0c4ab6 commit ab48675

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ dist
33
recallrai2/
44
**/__pycache__/
55
poetry.lock
6-
**/.env
6+
**/.env
7+
temp.ipynb

examples/examples.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@
347347
"try:\n",
348348
" context = session.get_context()\n",
349349
" print(\"Memory used:\", context.memory_used)\n",
350-
" print(\"Context:\", context.context)\n",
350+
" print(\"Context:\\n\", context.context)\n",
351351
"except UserNotFoundError as e:\n",
352352
" print(f\"Error: {e}\")\n",
353353
"except SessionNotFoundError as e:\n",

recallrai/session.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ def get_context(self) -> Context:
161161
)
162162
status = self.get_status()
163163
if status == SessionStatus.PROCESSED:
164-
logger.warning("WARNING: Cannot add message to a session that has already been processed")
164+
logger.warning("You are trying to get context for a processed session. Why do you need it?")
165165
elif status == SessionStatus.PROCESSING:
166-
logger.warning("WARNING: Cannot add message to a session that is currently being processed")
166+
logger.warning("You are trying to get context for a processing session. Why do you need it?")
167167
return Context.from_api_response(response.json())
168168

169169
def process(self) -> None:

0 commit comments

Comments
 (0)