Skip to content

Commit 1168b32

Browse files
committed
Fix final issues in section-4 notebooks
- Fixed memory_context list comprehension in 03_grounding_with_memory - Changed redis_config.get_redis_client() to redis_config.redis_client (property)
1 parent 46bf6bc commit 1168b32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python-recipes/context-engineering/notebooks/section-4-optimizations/03_grounding_with_memory.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
" )\n",
157157
" \n",
158158
" # Build context from memories\n",
159-
" memory_context = \"\\n\".join([f\"- {m.text}\" for m in memories]) if memories else \"None\".memories\n",
159+
" memory_context = \"\\n\".join([f\"- {m.text}\" for m in memories.memories]) if memories.memories else \"None\"\n",
160160
" \n",
161161
" system_prompt = f\"\"\"You are a helpful class scheduling agent for Redis University.\n",
162162
"\n",

python-recipes/context-engineering/notebooks/section-4-optimizations/05_crafting_data_for_llms.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
"memory_client = MemoryClient(config=config)\n",
173173
"llm = ChatOpenAI(model=\"gpt-4o\", temperature=0)\n",
174174
"tokenizer = tiktoken.encoding_for_model(\"gpt-4o\")\n",
175-
"redis_client = redis_config.get_redis_client()\n",
175+
"redis_client = redis_config.redis_client\n",
176176
"\n",
177177
"def count_tokens(text: str) -> int:\n",
178178
" return len(tokenizer.encode(text))\n",

0 commit comments

Comments
 (0)