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**

**Expected scenario/direction and few-shot**


**prompt generate by LLM**

--
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]