imbajin commented on code in PR #362:
URL: https://github.com/apache/hugegraph-ai/pull/362#discussion_r3394715365


##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/vector_graph_block.py:
##########
@@ -44,7 +44,56 @@
 )
 
 
-def store_prompt(doc, schema, example_prompt, 
graph_extract_split_type="document"):
+def _validate_schema_generator_examples(examples, label):
+    examples = (examples or "").strip()
+    if not examples:
+        return ""
+    try:
+        json.loads(examples)

Review Comment:
   ‼️ **Validate the schema-example shape, not only JSON syntax**
   
   Evidence: the persisted/bundled `query_examples.json` is a `list[str]`, but 
`SchemaBuildNode` only keeps parsed items that are dicts containing 
`description` and `gremlin`; the current head therefore reloads and persists 
examples that are later collapsed to an empty list before schema generation. 
The new tests cover YAML persistence and JSON syntax, but not that persisted 
query examples actually reach the schema prompt.
   
   Impact: users can save examples successfully and still generate schemas 
without any query examples, so this feature appears to work while silently 
dropping the main payload. Please align this validator with the downstream 
contract, or relax the downstream parser to accept the shipped string-list 
format, and add a regression test that persisted/bundled query examples produce 
a non-empty `query_examples` payload for schema generation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to