Skip to content

fix: forward system_prompt parameter in aquery_with_multimodal#258

Merged
LarFii merged 2 commits into
HKUDS:mainfrom
kuishou68:fix/issue-257-system-prompt-multimodal
Apr 25, 2026
Merged

fix: forward system_prompt parameter in aquery_with_multimodal#258
LarFii merged 2 commits into
HKUDS:mainfrom
kuishou68:fix/issue-257-system-prompt-multimodal

Conversation

@kuishou68

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug where system_prompt was silently ignored when calling aquery_with_multimodal.

Changes

  • Added system_prompt: str | None = None parameter to aquery_with_multimodal method signature (before **kwargs)
  • Forward system_prompt to the fallback aquery() call when no multimodal content is provided
  • Forward system_prompt to the main aquery() call for the enhanced query
  • Updated docstring to document the new parameter

Why

Without this fix, callers passing system_prompt to aquery_with_multimodal would have it silently ignored, even though the inner aquery() method supports it.

Closes #257

Signed-off-by: Cocoon-Break 54054995+kuishou68@users.noreply.github.com

…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 Abdeltoto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kuishou68 — clean, surgical fix. Verified the diff:

  • Signature change is backward-compatible (system_prompt defaults to None, 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.

@kuishou68

Copy link
Copy Markdown
Contributor Author

Good call on the docstring — updated it to clarify that system_prompt is forwarded as-is to the underlying aquery without transformation. Makes the contract clearer.

@LarFii LarFii merged commit b5eaccb into HKUDS:main Apr 25, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: forward system_prompt parameter in aquery_with_multimodal

3 participants