bitflicker64 commented on code in PR #410:
URL: https://github.com/apache/hugegraph-ai/pull/410#discussion_r4505347575
##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/rag_block.py:
##########
@@ -54,6 +55,10 @@ def rag_answer(
Generate an answer using the RAG (Retrieval-Augmented Generation) pipeline.
Fetch the Scheduler to deal with the request
"""
+ try:
+ validate_rag_query_length(text)
+ except ValueError as exc:
+ raise gr.Error(str(exc)) from exc
Review Comment:
Minor: `several_rag_answer` calls `rag_answer` row by row and writes the
Excel file only after the loop, so one question over `RAG_QUERY_MAX_LENGTH`
raises `gr.Error` after the earlier rows have run their LLM calls and discards
all their answers. Validate every question in `several_rag_answer` before the
loop, or record the error in that row and continue.
--
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]