8 Commits

Author SHA1 Message Date
zrguo
c56a3cc840 Merge pull request #263 from txhno/fix/send-dimensions-partial-wrapper
fix(examples): preserve embedding kwargs with partial
2026-04-25 17:19:02 +08:00
txhno
e5e0f4273c fix(examples): preserve embedding kwargs with partial 2026-04-22 18:40:11 +05:30
petercheng123
d79a687dfc fix: handle messages= kwarg in vision_model_func in insert_content_list_example
_call_vlm_with_multimodal_content passes a pre-built messages list via
messages= when doing VLM-enhanced queries with multimodal content. The
vision_model_func in insert_content_list_example.py was not accepting this
parameter, so it fell through to **kwargs and then into
openai_complete_if_cache which also builds its own messages from prompt —
causing "got multiple values for keyword argument 'messages'" TypeError.

Added messages=None parameter and a fast path that uses the pre-built
messages directly when provided, matching the pattern already used in
raganything_example.py.

Fixes #28
Fixes #98

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 10:46:24 -05:00
syshin0116
d29b81a2e6 fix(examples): use openai_embed.func to prevent double EmbeddingFunc wrapping
openai_embed is an EmbeddingFunc instance (decorated with
@wrap_embedding_func_with_attrs). Wrapping it inside a lambda and
passing it to another EmbeddingFunc causes double invocation of
EmbeddingFunc.__call__, which doubles the returned vector count and
raises "Vector count mismatch: expected N vectors but got 2N vectors".

Using openai_embed.func accesses the unwrapped async function directly,
as documented in lightrag-hku's own codebase.

Fixes the root cause of HKUDS/LightRAG#2549.
2026-03-16 19:15:53 +09:00
laansdole
ab552321ae chores: refactor examples 2025-10-04 21:27:41 +07:00
zrguo
991794361f Compatible with new fields 2025-09-16 11:10:26 +08:00
zrguo
84276c38ca fix lint 2025-07-23 19:04:11 +08:00
zrguo
710ed38d88 direct content list insertion 2025-07-23 19:01:26 +08:00