-
Notifications
You must be signed in to change notification settings - Fork 435
fix: adjust some server_router examples(Should be reviewed by Chenyang Xi) #962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev-20260126-v2.0.4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. | ||
|
|
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: