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,