feat(gui): Implement RAG Settings panel in AI Settings
This commit is contained in:
+40
-1
@@ -672,8 +672,9 @@ class App:
|
||||
self._render_provider_panel()
|
||||
if imgui.collapsing_header("System Prompts"):
|
||||
self._render_system_prompts_panel()
|
||||
if imgui.collapsing_header("RAG Settings"):
|
||||
self._render_rag_panel()
|
||||
self._render_agent_tools_panel()
|
||||
|
||||
imgui.end()
|
||||
if self.ui_separate_usage_analytics and self.show_windows.get("Usage Analytics", False):
|
||||
exp, opened = imgui.begin("Usage Analytics", self.show_windows["Usage Analytics"])
|
||||
@@ -4372,6 +4373,44 @@ def hello():
|
||||
self.show_preset_manager_window = True
|
||||
imgui.set_item_tooltip("Open preset management modal")
|
||||
ch, self.ui_project_system_prompt = imgui.input_text_multiline("##psp", self.ui_project_system_prompt, imgui.ImVec2(-1, 100))
|
||||
def _render_rag_panel(self) -> None:
|
||||
conf = self.controller.rag_config
|
||||
if not conf: return
|
||||
ch, conf.enabled = imgui.checkbox("Enable RAG", conf.enabled)
|
||||
|
||||
imgui.text("Vector Store Provider")
|
||||
providers = ['chroma', 'qdrant', 'mock']
|
||||
try:
|
||||
idx = providers.index(conf.vector_store.provider)
|
||||
except (ValueError, AttributeError):
|
||||
idx = 0
|
||||
ch2, next_idx = imgui.combo("##rag_provider", idx, providers)
|
||||
if ch2:
|
||||
conf.vector_store.provider = providers[next_idx]
|
||||
|
||||
imgui.text("Embedding Provider")
|
||||
emb_providers = ['gemini', 'local']
|
||||
try:
|
||||
idx_e = emb_providers.index(conf.embedding_provider)
|
||||
except (ValueError, AttributeError):
|
||||
idx_e = 0
|
||||
ch3, next_idx_e = imgui.combo("##rag_emb_provider", idx_e, emb_providers)
|
||||
if ch3:
|
||||
conf.embedding_provider = emb_providers[next_idx_e]
|
||||
|
||||
imgui.text("Chunk Size")
|
||||
imgui.set_next_item_width(150)
|
||||
ch4, conf.chunk_size = imgui.input_int("##rag_chunk_size", conf.chunk_size)
|
||||
imgui.text("Chunk Overlap")
|
||||
imgui.set_next_item_width(150)
|
||||
ch5, conf.chunk_overlap = imgui.input_int("##rag_chunk_overlap", conf.chunk_overlap)
|
||||
|
||||
imgui.separator()
|
||||
imgui.text(f"Status: {self.controller.rag_status}")
|
||||
|
||||
if imgui.button("Rebuild Index"):
|
||||
self.controller._rebuild_rag_index()
|
||||
|
||||
def _render_agent_tools_panel(self) -> None:
|
||||
if imgui.collapsing_header("Active Tool Presets & Biases", imgui.TreeNodeFlags_.default_open):
|
||||
imgui.text("Tool Preset")
|
||||
|
||||
Reference in New Issue
Block a user