- Issue created by @anjaliprasannan
- @anjaliprasannan opened merge request.
- š®š³India annmarysruthy
Reviewed the MR and tested the changes. Even after applying the changes, the Enable RAG checkbox will be disabled on each edit , if no agent is selected.
Kindly check again
- š®š³India anjaliprasannan
Before moving forward with the fix, I want to confirm if the RAG Search dependency on agent selection in AiAssistantForm expected behavior?
In this code
if ($form_state->get('agents_enabled') || $form_state->getValue('ai_agent')) { // ... other agent logic ... if ($form_state->getValue('enable_rag')) { $tools['ai_search:rag_search'] = TRUE; $tool_usage_limits['ai_search:rag_search'] = [ // RAG settings ]; } }
RAG functionality is only applied when: The ai_agents module is enabled and an ai_agent is selected in the "Use agent as assistant" field. As a result, if no agent is selected or the ai_agents module is disabled, enabling the "Enable RAG" checkbox and configuring RAG settings has no effect, as the ai_search:rag_search tool is not added to tools or tool_usage_limits. Is this dependency on agent selection the expected behavior for RAG functionality? Or should RAG be available independently when the ai_search module is enabled and the "Enable RAG" checkbox is checked?
If so, Iām considering moving the RAG logic outside the agent condition, placing it within the existing if ($this->moduleHandler->moduleExists('ai_search')) block in submitForm. This would allow RAG to function independently of agent selection.