Skip to content

fix: get_graph_labels always returns empty arrays#4

Open
magnus919 wants to merge 2 commits into
desimpkins:mainfrom
magnus919:fix/get-graph-labels-empty-arrays
Open

fix: get_graph_labels always returns empty arrays#4
magnus919 wants to merge 2 commits into
desimpkins:mainfrom
magnus919:fix/get-graph-labels-empty-arrays

Conversation

@magnus919
Copy link
Copy Markdown

Summary

  • Fixes field name mismatch in client.py where the /graph/label/list API response (a flat list) was wrapped as {"labels": ...}, but LabelsResponse has entity_labels / relation_labels fields — no labels field exists. Pydantic silently dropped the value, so both fields always defaulted to [].
  • Changed mapping to {"entity_labels": response_data} so the list populates the correct field.

Test

Verified against live instance with 32,240 entity labels — previously returned [], now returns all labels correctly.

Closes #3

Test plan

  • Call get_graph_labels against a populated LightRAG instance and confirm entity_labels is non-empty
  • Confirm relation_labels is [] (endpoint only provides entity labels)

🤖 Generated with Claude Code

magnus919 and others added 2 commits April 13, 2026 22:46
The client wrapped the API's flat list as {"labels": ...}, but
LabelsResponse has entity_labels/relation_labels fields — no "labels"
field. Pydantic silently dropped the value, causing get_graph_labels
to always return empty arrays.

Closes desimpkins#3

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
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.

get_graph_labels always returns empty arrays despite populated knowledge graph

1 participant