From 28cad8dff93db87cc8045c5871d77a7936a8b0d2 Mon Sep 17 00:00:00 2001 From: Yngrid Coello Date: Sun, 30 Jun 2024 09:33:28 +0200 Subject: [PATCH] [Obs AI Assistant] Awaiting elasticsearch response (#187170) The assistant is not able to retrieve information from `elasticsearch` function https://github.com/elastic/kibana/assets/1313018/c5ba41bd-3c24-4390-a9f6-f1bde0640b4c After awaiting the response the assistant is sucessfully returning the information https://github.com/elastic/kibana/assets/1313018/bbf45e80-79a8-4bad-b248-4ef37c7317b3 --- .../server/functions/elasticsearch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts index 81a9cffc6d033..8c255b885fd4c 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts @@ -39,7 +39,7 @@ export function registerElasticsearchFunction({ }, async ({ arguments: { method, path, body } }) => { const esClient = (await resources.context.core).elasticsearch.client; - const response = esClient.asCurrentUser.transport.request({ + const response = await esClient.asCurrentUser.transport.request({ method, path, body,