You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hugegraph.apache.org by "day0n (via GitHub)" <gi...@apache.org> on 2025/06/06 06:49:40 UTC

[PR] feat(llm): support prompt: EN/CN( #260) [incubator-hugegraph-ai]

day0n opened a new pull request, #268:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/268

   ## Support switching between Chinese and English in the prompt.


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] feat(llm): support prompt: EN/CN( #260) [incubator-hugegraph-ai]

Posted by "imbajin (via GitHub)" <gi...@apache.org>.
imbajin commented on code in PR #268:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/268#discussion_r2131704649


##########
hugegraph-llm/src/hugegraph_llm/demo/rag_demo/app.py:
##########
@@ -105,6 +110,41 @@ def init_rag_ui() -> gr.Interface:
         with gr.Tab(label="5. Admin Tools 🛠"):
             create_admin_block()
 
+            def switch_language(current_lang):
+                new_lang = "CN" if current_lang == "EN" else "EN"
+                if new_lang == "CN":
+                    updates = (
+                        gr.update(value=f"prompt: {new_lang}"),
+                        gr.update(value=prompt.doc_input_text_CN),
+                        gr.update(value=prompt.extract_graph_prompt_CN),
+                        gr.update(value=prompt.answer_prompt_CN),
+                        gr.update(value=prompt.keywords_extract_prompt_CN),
+                        gr.update(value=prompt.gremlin_generate_prompt_CN),
+                    )
+                else:
+                    updates = (
+                        gr.update(value=f"prompt: {new_lang}"),
+                        gr.update(value=prompt.doc_input_text),
+                        gr.update(value=prompt.extract_graph_prompt),
+                        gr.update(value=prompt.answer_prompt),
+                        gr.update(value=prompt.keywords_extract_prompt),
+                        gr.update(value=prompt.gremlin_generate_prompt),
+                    )

Review Comment:
   Note the consistency of prompts on the **API** and **UI** to avoid reading inconsistent prompts when the API accesses them



-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] feat(llm): support prompt: EN/CN( #260) [incubator-hugegraph-ai]

Posted by "day0n (via GitHub)" <gi...@apache.org>.
day0n commented on PR #268:
URL: https://github.com/apache/incubator-hugegraph-ai/pull/268#issuecomment-2948277158

   <img width="1274" alt="image" src="https://github.com/user-attachments/assets/fd45760d-b249-4d5d-b460-d5ab4473dd8c" />
   


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org


Re: [PR] feat(llm): support switch prompt language EN/CN [incubator-hugegraph-ai]

Posted by "day0n (via GitHub)" <gi...@apache.org>.
day0n closed pull request #268: feat(llm): support  switch prompt language EN/CN
URL: https://github.com/apache/incubator-hugegraph-ai/pull/268


-- 
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: issues-unsubscribe@hugegraph.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@hugegraph.apache.org
For additional commands, e-mail: issues-help@hugegraph.apache.org