Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Obs AI Assistant] Include an AdHoc instruction about the slack conne…
…ctor to avoid executing a loop (elastic#199531) Closes elastic#185028 ## Summary ### Problem The ticket mentions that there was an issue with displaying results. However both `display results` and `visualize query` are working as expected based on my investigation. More details including a video are attached [here](elastic#185028 (comment)). The function calling loop seems to occur when the AI Assistant is trying to send the output to Slack via the Kibana Slack connector. In order to do this, the LLM invokes the function `execute_connector`. For the Slack connector, `id` and `params` properties are required. However, the LLM only populated `id` and not `params` which causes an error when validated against the schema for the Slack connector. - Sometimes, it's able to retry a few times and successfully send the output to Slack. - Sometimes, it goes into a loop trying to find `params` and failing repeatedly. Attaching another similar issue for more context - elastic#195564 _With the solution below, my intention is to send the output to Slack in one go, without retrying the function `execute_connector`._ ### Solution Based on the solutions I experimented with, seems like we need to force the LLM to understand what's needed for the Slack connector. I tried a few options here and the combination of updates that worked are as follows: - Appending an AdHoc instruction about the Slack connector properties. (This gives the LLM some additional information about the required properties) - Updating the `properties` attached to the connector (when passing the connector list to the LLM), to reflect both `id` and `params` with `message`. With the above change, the AI Assistant has managed to consistently send the output to Slack _**without any retries**_ because of missing `params`. ### Screenshots: (all alert triggers successfully sent the output to Slack without having to retry the function) <img width="1452" alt="success-attempts-to-slack-connector" src="https://github.com/user-attachments/assets/715a5957-2c04-4a55-868f-34abe564f6d4">
- Loading branch information