diff options
| author | Michael Peter Christen <mc@yacy.net> | 2025-12-06 19:21:57 +0100 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2025-12-06 19:21:57 +0100 |
| commit | eed704d23bc53e5d0359072e5e2134b469ae2eef (patch) | |
| tree | 2518c10e9e478a4c04845db3b81442ee9dfca7cb /htroot | |
| parent | ed9ea238b1e7d4a89d77acea790b08b6f2b1ed49 (diff) | |
added RAG configuration page
Diffstat (limited to 'htroot')
| -rw-r--r-- | htroot/AILab.html | 2 | ||||
| -rw-r--r-- | htroot/RAGConfig_p.html | 61 | ||||
| -rw-r--r-- | htroot/env/templates/submenuAI.template | 1 | ||||
| -rw-r--r-- | htroot/yacychat.html | 2 |
4 files changed, 64 insertions, 2 deletions
diff --git a/htroot/AILab.html b/htroot/AILab.html index 09f007ba4..cbf330393 100644 --- a/htroot/AILab.html +++ b/htroot/AILab.html @@ -299,7 +299,7 @@ <img src="env/grafics/AILab_RAG.png" alt="RAG configuration" width="128" height="128" /> </div> <div class="quest-actions"> - <a class="btn btn-info btn-sm" href="LLMSelection_p.html#productionModelsTable">Configure RAG roles</a> + <a class="btn btn-primary btn-sm" href="RAGConfig_p.html">Wire RAG prompts</a> <a class="btn btn-info btn-sm" href="yacychat.html">Test in Chat</a><br /> <span class="quest-note">Set the search-query and qapairs columns to connect retrieval to your chat flow.</span> </div> diff --git a/htroot/RAGConfig_p.html b/htroot/RAGConfig_p.html new file mode 100644 index 000000000..51317e78d --- /dev/null +++ b/htroot/RAGConfig_p.html @@ -0,0 +1,61 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>YaCy '#[clientname]#': Wire RAG Retrieval</title> + #%env/templates/metas.template%# + <style type="text/css"> + .rag-card { + border: 1px solid #e6e9ef; + border-left: 6px solid #5bc0de; + padding: 18px; + margin-bottom: 16px; + background: #fff; + box-shadow: 0 3px 10px rgba(0,0,0,0.06); + } + .rag-card h3 { + margin-top: 0; + margin-bottom: 8px; + color: #0f2b46; + } + .rag-card p { + margin: 0 0 10px 0; + color: #3b4a5e; + } + .rag-textarea { + width: 100%; + resize: vertical; + } + </style> + </head> + <body id="IndexControl"> + #%env/templates/header.template%# + #%env/templates/submenuAI.template%# + + <h2>Wire RAG Retrieval</h2> + <p>Tune how YaCy constructs prompts and search queries for Retrieval Augmented Generation.</p> + + <form method="post" action="RAGConfig_p.html"> + <div class="rag-card"> + <h3>System Prompt</h3> + <p>This is sent as the system message for chats. Keep it concise and friendly.</p> + <textarea name="ai.system-prompt" class="rag-textarea form-control" rows="5">#[ai.system-prompt]#</textarea> + </div> + + <div class="rag-card"> + <h3>User Retrieval Prefix</h3> + <p>Prepended before attached search snippets in RAG mode to tell the LLM how to use them.</p> + <textarea name="ai.llm-user-prefix" class="rag-textarea form-control" rows="5">#[ai.llm-user-prefix]#</textarea> + </div> + + <div class="rag-card"> + <h3>Query Generator Prefix</h3> + <p>Prompt given to the model that generates search queries from user requests.</p> + <textarea name="ai.llm-query-generator-prefix" class="rag-textarea form-control" rows="5">#[ai.llm-query-generator-prefix]#</textarea> + </div> + + <button type="submit" class="btn btn-primary">Save RAG Settings</button> + </form> + + #%env/templates/footer.template%# + </body> +</html> diff --git a/htroot/env/templates/submenuAI.template b/htroot/env/templates/submenuAI.template index a5badb975..614dff4a1 100644 --- a/htroot/env/templates/submenuAI.template +++ b/htroot/env/templates/submenuAI.template @@ -3,6 +3,7 @@ <ul class="SubMenu"> <li><a href="AILab.html" class="MenuItemLink">AI Lab</a></li> <li><a href="LLMSelection_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">LLM Selection</a></li> + <li><a href="RAGConfig_p.html" class="MenuItemLink #(authorized)#lock::unlock#(/authorized)#">RAG Config</a></li> <li><a href="yacychat.html" class="MenuItemLink">Chat</a></li> </ul> </div> diff --git a/htroot/yacychat.html b/htroot/yacychat.html index d8fc210dc..26ee71cd1 100644 --- a/htroot/yacychat.html +++ b/htroot/yacychat.html @@ -601,7 +601,7 @@ <script src="js/marked.umd.js"></script> <script src="js/index.umd.min.js"></script> <script type="text/javascript"> - const SYSTEM_PROMPT = 'You are a smart and helpful chatbot. If possible, use friendly emojies.'; + const SYSTEM_PROMPT = '#[system_prompt]#'; const defaultApiHost = ''; const STORAGE_KEY = 'yacychat_recent_pairs'; |
