## Summary This PR adds a new api for deleting all conversations without providing conversation ids. It takes excluded ids to skip the conversations that are not going to be deleted. example: Deleting all conversations except the latest one. <img width="2558" alt="Screenshot 2025-06-19 at 10 28 19" src="https://github.com/user-attachments/assets/eef4c9ef-1415-47b4-ad84-957bfd7f6874" /> ``` delete `/app/management/kibana/securityAiAssistantManagement` {"excludedIds":["7X-Dh5cBzHjHjpq0iVDH"]} ``` To test: (Test env: https://p.elstc.co/paste/UjwhcpLK#-Bi4EAfwWwrJNg0kCHz4mZVDy8k16HtNlf9FdJgUM7K) 1. Add some conversations from dev tools: <details> <summary><i>mock conversations:</i></summary> ``` POST .kibana-elastic-ai-assistant-conversations-default/_bulk { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 3", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T08:20:00Z", "content": "Tell me a joke.", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T08:20:01Z", "content": "Why did the chicken cross the road? To get to the other side!", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T08:20:01Z", "confidence": "low", "content": "User asked for a joke, assistant provided one.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-003", "value": "value-003" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 4", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T08:30:00Z", "content": "What is the capital of France?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T08:30:01Z", "content": "The capital of France is Paris.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T08:30:01Z", "confidence": "high", "content": "User asked about the capital of France, assistant answered correctly.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-004", "value": "value-004" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 5", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T08:40:00Z", "content": "How do I reset my password?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T08:40:01Z", "content": "To reset your password, go to settings and click 'Reset Password'.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T08:40:01Z", "confidence": "medium", "content": "User asked how to reset password, assistant provided instructions.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-005", "value": "value-005" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 6", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T08:50:00Z", "content": "What is the meaning of life?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T08:50:01Z", "content": "The meaning of life is subjective and varies for each individual.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T08:50:01Z", "confidence": "low", "content": "User asked philosophical question, assistant provided general answer.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-006", "value": "value-006" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 7", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T09:00:00Z", "content": "Can you help me with my homework?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T09:00:01Z", "content": "Sure! What subject is your homework in?", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T09:00:01Z", "confidence": "high", "content": "User asked for homework help, assistant offered to assist.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-007", "value": "value-007" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 8", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T09:10:00Z", "content": "What is the best programming language?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T09:10:01Z", "content": "It depends on your needs, but Python is a great choice for beginners.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T09:10:01Z", "confidence": "medium", "content": "User asked about programming languages, assistant provided recommendation.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-008", "value": "value-008" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 9", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T09:20:00Z", "content": "How do I improve my writing skills?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T09:20:01Z", "content": "Practice regularly, read widely, and seek feedback.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T09:20:01Z", "confidence": "high", "content": "User asked about writing skills, assistant provided tips.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-009", "value": "value-009" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 10", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T09:30:00Z", "content": "What is the best way to learn a new language?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T09:30:01Z", "content": "Immersion, practice speaking, and using language learning apps are effective.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T09:30:01Z", "confidence": "medium", "content": "User asked about language learning, assistant provided methods.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-010", "value": "value-010" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 11", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T09:40:00Z", "content": "What are some tips for public speaking?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T09:40:01Z", "content": "Practice, know your material, and engage with your audience.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T09:40:01Z", "confidence": "high", "content": "User asked about public speaking, assistant provided tips.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-011", "value": "value-011" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 12", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T09:50:00Z", "content": "How can I improve my time management skills?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T09:50:01Z", "content": "Prioritize tasks, set deadlines, and use tools like calendars.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T09:50:01Z", "confidence": "medium", "content": "User asked about time management, assistant provided strategies.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-012", "value": "value-012" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 13", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T10:00:00Z", "content": "What are some effective study techniques?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T10:00:01Z", "content": "Active recall, spaced repetition, and summarization are effective.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T10:00:01Z", "confidence": "high", "content": "User asked about study techniques, assistant provided methods.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-013", "value": "value-013" } } { "create": {}} { "@timestamp": "2025-06-10T08:00:00Z", "title": "Example Conversation 14", "api_config": { "action_type_id": ".inference", "connector_id": "elastic-llm" }, "messages": [ { "@timestamp": "2025-06-10T10:10:00Z", "content": "How can I enhance my critical thinking skills?", "is_error": false, "role": "user", "metadata": { "content_references": {} } }, { "@timestamp": "2025-06-10T10:10:01Z", "content": "Engage in debates, analyze arguments, and reflect on your reasoning.", "is_error": false, "role": "assistant", "metadata": { "content_references": {} } } ], "summary": { "@timestamp": "2025-06-10T10:10:01Z", "confidence": "medium", "content": "User asked about critical thinking, assistant provided tips.", "public": true }, "users": [ { "name": "elastic", "id": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0" } ], "replacements": { "uuid": "repl-014", "value": "value-014" } } ``` </details> 2. Visit `/app/management/kibana/securityAiAssistantManagement` and try deleting conversations. If it's a delete all request, the request should look like this: ``` delete `/app/management/kibana/securityAiAssistantManagement` ``` <img width="1281" alt="Screenshot 2025-06-16 at 12 59 01" src="https://github.com/user-attachments/assets/9f9562f3-b5d8-4c3b-9418-8550ce24a6b0" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
examples | ||
linters | ||
output | ||
overlays | ||
scripts | ||
bundle.json | ||
bundle.serverless.json | ||
kibana.info.serverless.yaml | ||
kibana.info.yaml | ||
makefile | ||
package-lock.json | ||
package.json | ||
README.md |
Kibana API reference documentation
Documentation about our OpenAPI bundling workflow and configuration. See Kibana's hosted stateful and serverless docs.
Workflow
The final goal of this workflow is to produce an OpenAPI bundle containing all Kibana's public APIs.
Step 0
OAS from Kibana's APIs are continuously extracted and captured in bundle.json
and bundle.serverless.json
as fully formed OAS documentation. See node scripts/capture_oas_snapshot --help
for more info.
These bundles form the basis of our OpenAPI bundles to which we append and layer extra information before publishing.
Step 1
Append pre-existing bundles not extracted from code using kbn-openapi-bundler
to produce the final resulting bundles.
To add more files into the final bundle, edit the appropriate oas_docs/scripts/merge*.js
files.
Step 2
Apply any final overalys to the document that might include examples or final tweaks (see the "Scripts" section for more details).
Scripts
The oas_docs/scripts
folder contains scripts that point to the source domain-specific OpenAPI bundles and specify additional parameters for producing the final output bundle. Currently, there are the following scripts:
-
merge_ess_oas.js
script produces production an output bundle for ESS -
merge_serverless_oas.js
script produces production an output bundle for Serverless
Output Kibana OpenAPI bundles
The oas_docs/output
folder contains the final resulting Kibana OpenAPI bundles
kibana.yaml
production ready ESS OpenAPI bundlekibana.serverless.yaml
production ready Serverless OpenAPI bundle
Bundling commands
Besides the scripts in the oas_docs/scripts
folder, there is an oas_docs/makefile
to simplify the workflow. Use make help
to see available commands.