fix: forward system_prompt parameter in aquery_with_multimodal#258
Merged
LarFii merged 2 commits intoApr 25, 2026
Merged
Conversation
…d it to inner aquery() calls Closes HKUDS#257 The aquery_with_multimodal method lacked an explicit system_prompt parameter, causing it to be silently ignored when passed via **kwargs. This commit adds system_prompt: str | None = None to the signature and forwards it to all inner aquery() calls. Signed-off-by: Cocoon-Break <54054995+kuishou68@users.noreply.github.com>
Abdeltoto
approved these changes
Apr 22, 2026
Abdeltoto
left a comment
Contributor
There was a problem hiding this comment.
Thanks @kuishou68 — clean, surgical fix. Verified the diff:
- Signature change is backward-compatible (
system_promptdefaults toNone, placed before**kwargs). - Both forwarding paths are covered (the early text-only fallback and the post-enhanced query call).
- Closes #257 cleanly.
LGTM 👍
One tiny nit (non-blocking): the docstring entry "Optional system prompt to include in the query" could be slightly more precise — something like "Optional system prompt forwarded as-is to the underlying aquery (see LightRAG's aquery for exact handling)" — to make it clear there's no transformation happening here. Totally optional, feel free to ignore.
Contributor
Author
|
Good call on the docstring — updated it to clarify that |
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where
system_promptwas silently ignored when callingaquery_with_multimodal.Changes
system_prompt: str | None = Noneparameter toaquery_with_multimodalmethod signature (before**kwargs)system_promptto the fallbackaquery()call when no multimodal content is providedsystem_promptto the mainaquery()call for the enhanced queryWhy
Without this fix, callers passing
system_prompttoaquery_with_multimodalwould have it silently ignored, even though the inneraquery()method supports it.Closes #257
Signed-off-by: Cocoon-Break 54054995+kuishou68@users.noreply.github.com