fix: adjust some server_router examples#962
fix: adjust some server_router examples#962Mozy403 wants to merge 3 commits intoMemTensor:dev-20260126-v2.0.4from
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the server_router_api.py example script to better demonstrate server_router /product/add usage patterns, especially around sync/async modes and multimodal message shapes.
Changes:
- Added new sync-mode examples for
fastandfinepipelines. - Reworked multimodal examples into multiple focused variants (image+text, file+text, fine image analysis, fast image save).
- Added clarifying notes to tool-calling examples and updated the entry-point execution list accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "info": {"source_type": "image_analysis"}, | ||
| } | ||
| call_add_api("example_02c_tool_description_input_output", payload) | ||
| call_add_api("example_03_multimodal_text_and_image", payload) |
There was a problem hiding this comment.
call_add_api example name is inconsistent with the function name (example_03a_multimodal_text_and_image). This makes logs harder to correlate and breaks the otherwise consistent pattern in this file. Rename the string argument to match the function name (or rename the function back), so the printed "Example:" label is accurate.
| call_add_api("example_03_multimodal_text_and_image", payload) | |
| call_add_api("example_03a_multimodal_text_and_image", payload) |
| def example_02a_assistant_with_tool_calls(): | ||
| """ | ||
| Assistant message containing tool_calls (function calls). | ||
| both multi_model_struct and simple_struct memreaders support this format. |
There was a problem hiding this comment.
The docstring mentions multi_model_struct, but the repository config uses multimodal_struct (e.g., MEM_READER_BACKEND=multimodal_struct). This is likely a typo and can mislead users trying to run the example. Update the backend name and capitalize the sentence start ("Both ...").
| both multi_model_struct and simple_struct memreaders support this format. | |
| Both multimodal_struct and simple_struct memreaders support this format. |
| Tool message returning the result of a tool call. | ||
| only multi_model_struct memreader supports this format. | ||
|
|
There was a problem hiding this comment.
The docstring mentions multi_model_struct, but the supported backend appears to be multimodal_struct in the codebase. Also, capitalize the sentence start ("Only ...").
| "async_mode": "sync", | ||
| "mode": "fast", |
There was a problem hiding this comment.
There is trailing whitespace on these lines (e.g., after the comma). This will fail the repo’s formatting/lint checks (ruff format / trailing-whitespace hook). Remove the extra spaces.
| "async_mode": "sync", | ||
| "mode": "fine", |
There was a problem hiding this comment.
Trailing whitespace is present on these lines (e.g., after the comma). This will cause formatter/pre-commit checks to fail. Remove the extra spaces.
Description
Summary: (summary)
Fix: #(issue)
Docs Issue/PR: (docs-issue-or-pr-link)
Reviewer: @(reviewer)
Checklist: