|
254 | 254 | "## 5. Wait for the Function App to produce a summary\n", |
255 | 255 | "\n", |
256 | 256 | "`process_now_and_wait` polls Cosmos for the thread's summary doc until `timeout` seconds. This is **RU-costly**\n", |
257 | | - "(repeated `get_memories(memory_type='summary')` queries) — only use it for demos and tests.\n", |
| 257 | + "(repeated `get_memories(memory_types=['summary'])` queries) — only use it for demos and tests.\n", |
258 | 258 | "\n", |
259 | 259 | "> If this returns `False`, check that:\n", |
260 | 260 | "> * The Function App is deployed and running.\n", |
|
594 | 594 | "def _show():\n", |
595 | 595 | " counts = {}\n", |
596 | 596 | " for mt in (\"summary\", \"fact\", \"episodic\", \"procedural\", \"user_summary\"):\n", |
597 | | - " docs = memory.get_memories(user_id=USER_ID, memory_type=mt)\n", |
| 597 | + " docs = memory.get_memories(user_id=USER_ID, memory_types=[mt])\n", |
598 | 598 | " counts[mt] = len(docs)\n", |
599 | 599 | " print(f\"\\n{mt.upper()}S ({len(docs)}):\")\n", |
600 | 600 | " for d in docs:\n", |
|
610 | 610 | " break\n", |
611 | 611 | " print(f\"\\n... fact / procedural extraction still in flight (attempt {attempt+1}/6, sleeping 15s)\")\n", |
612 | 612 | " time.sleep(15)\n", |
613 | | - " counts = {mt: len(memory.get_memories(user_id=USER_ID, memory_type=mt))\n", |
| 613 | + " counts = {mt: len(memory.get_memories(user_id=USER_ID, memory_types=[mt]))\n", |
614 | 614 | " for mt in (\"summary\", \"fact\", \"episodic\", \"procedural\", \"user_summary\")}\n", |
615 | 615 | "\n", |
616 | 616 | "print(\"\\n=== Final state ===\")\n", |
|
627 | 627 | "* **Per-turn embedding**: the SDK auto-embeds non-`turn` documents you `add_cosmos` directly. Raw `turn`\n", |
628 | 628 | " records are intentionally not embedded — the function app does that during summary/extraction.\n", |
629 | 629 | "* **Search across function-app-produced memories**: works exactly as in the in-process demo:\n", |
630 | | - " `memory.search_cosmos(search_terms=\"…\", memory_type=\"fact\", user_id=USER_ID)`.\n", |
| 630 | + " `memory.search_cosmos(search_terms=\"…\", memory_types=[\"fact\"], user_id=USER_ID)`.\n", |
631 | 631 | "* **Switch back to in-process** for ad-hoc work: instantiate the client without the `processor=` kwarg\n", |
632 | 632 | " (or pass `InProcessProcessor()` explicitly) and use `generate_thread_summary` / `extract_memories`\n", |
633 | 633 | " directly." |
|
0 commit comments