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

   ### Overview 
   This PR aims to introduce a semi-automated Prompt generation feature. This 
functionality leverages the capabilities of large language models (LLMs), 
allowing users to generate a highly customized Prompt for knowledge graph 
extraction by simply providing the original text, a description of the desired 
scenario, and selecting one example from a few system-provided examples that 
best matches their scenario. The generated Prompt serves as a reference for 
users, reducing the difficulty for them to get started.
   ### Main Changes
   
   * **New Operator: `prompt_generate.py`**
       * Adds the `PromptGenerate` operator, which is responsible for 
constructing the meta-prompt by combining user inputs with a selected few-shot 
example, invoking the LLM, and returning the generated prompt.
   
   * **Built-in Prompt Examples & Configuration:**
       * Adds `prompt_examples.json`, a centralized file to store multiple, 
high-quality, structured few-shot examples for different domains.
       * Updates `prompt_config.py` with a new meta-prompt template 
(`generate_extract_prompt_template`) designed to guide the LLM in this 
generation task.
   
   * **UI & Workflow Updates:**
       * Updates `vector_graph_block.py` to add a collapsible "Assist in 
generating graph extraction prompts" section in the “Build RAG Index” tab.
       * This new UI section includes a dropdown for selecting few-shot 
examples and a dynamic preview area that updates on selection.
       * Fixes a UI "cold start" bug by implementing a `demo.load()` event to 
ensure the preview for the default example is displayed on initial page load.
   
   ### New UI interface features
   **New interface location**
   
   
![image](https://github.com/user-attachments/assets/1d5c0a1c-8add-4a89-9b17-d32d09379bce)
   **Expected scenario/direction and few-shot**
   
   
![image](https://github.com/user-attachments/assets/16d672b6-bab2-4ad1-85dd-1c8a9e61b841)
   
![image](https://github.com/user-attachments/assets/c77e323b-3dd6-45d7-b84c-36606fab6542)
   **prompt generate by LLM**
   
   
![image](https://github.com/user-attachments/assets/5fffb36c-4a67-43bb-9762-b08065682e1e)
   


-- 
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-unsubscr...@hugegraph.apache.org

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


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

Reply via email to