# AI assistant giving errors

**URL:** <https://discuss.elastic.co/t/ai-assistant-giving-errors/373285>\
**Category:** Kibana\
**Tags:** elastic-ai-assistant\
**Created:** [January 16, 2025, 2:56pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285 "2025-01-16T14:56:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![flalar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flalar/32/85777_2.png) [@flalar](https://discuss.elastic.co/u/flalar)\
**Post date:** [January 16, 2025, 2:56pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/1 "2025-01-16T14:56:16Z")

</div>

We've set up the Azure OpenAI connector and things are looking good when testing the connector. We also see requests comming into the model on the Azure side.

However we get an error in Kibana saying

```auto
Failed to load response from the AI Assistant
Error: an error occurred while running the action - Status code: 400. Message: API Error: model_error - 'arguments' is a required property - 'messages.4.function_call

```

Anyone have any input on what is wrong or how to debug this further?

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [January 16, 2025, 8:08pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/2 "2025-01-16T20:08:53Z")

</div>

Thanks for reaching out, @flalar. Can you say a bit more about how you connect here?

While this isn't exactly the same issue, I did find some related Stack Overflow [posts](https://stackoverflow.com/questions/75971578/openai-chat-completions-api-error-messages-is-a-required-property-when-test) to suggest this may be related to how you are formatting your request, so if you have a code snippet, that may be helpful.

Also, what version of Elastic are you using?

---

<div class="post-metadata">

**Author:** ![flalar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flalar/32/85777_2.png) [@flalar](https://discuss.elastic.co/u/flalar)\
**Post date:** [January 16, 2025, 8:48pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/3 "2025-01-16T20:48:19Z")

</div>

Yea, we saw those stackoverflow post too .

We can trigger the error by clicking any option related to the AI Assistant within Kibana. To be specific we can do it from the Observability \> Logs Explorer \> Log Details \> What is this message

 ![kibanaError](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e1332b75ab8ebb8d0df1e41ea1a88d6c3ab09cb2.png)

we get this stack trace

```auto
Error: an error occurred while running the action - Status code: 400. Message: API Error: model_error - 'arguments' is a required property - 'messages.4.function_call'
    at Object.next (https://urltoelasticcluster/465f50087cd0/bundles/plugin/observabilityAIAssistant/1.0.0/observabilityAIAssistant.chunk.2.js:3:456)
    at https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:377:1543010
    at t._next (https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:46050)
    at t.next (https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:30508)
    at https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:24634
    at t._next (https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:6:46050)
    at t.next (https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:30508)
    at https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:351:64560
    at i (https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361:239716)
    at t.next (https://urltoelasticcluster/465f50087cd0/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:351:64347)

```

And we find this corresponding message in the kibana logs

action execution failure: .gen-ai:f8762be4-357c-4c7a-82f6-0cff6f879399: AzOpenAI

We are on Version 8.14.3

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [January 17, 2025, 3:56pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/4 "2025-01-17T15:56:28Z")

</div>

Thanks, @flalar. Was this working at one point, or did you get errors when setting it up? How is your connector set up?

You may want to double-check our guide on setting up, too:

> **[Observability AI Assistant | Elastic Observability \[8.14\] | Elastic](https://www.elastic.co/guide/en/observability/8.14/obs-ai-assistant.html)**

---

<div class="post-metadata">

**Author:** ![flalar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flalar/32/85777_2.png) [@flalar](https://discuss.elastic.co/u/flalar)\
**Post date:** [January 20, 2025, 2:22pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/5 "2025-01-20T14:22:55Z")

</div>

We did double check the guide

Our deployment had defaulted to gpt-4 turbo with api-version=2024-08-01-preview

We redeployed it with gpt-4 0613 and set the api-version=2023-07-01-preview like de documentation states, but we still get the same error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7fb2f25f552335b4d853eb8492afa1d77fa14d9c.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b50d104a3b7efe6e2a65ceef58af513162685d9.png)

When testing the connector from the connectors page is says "test was successful"

From any other page using the AI assistant, we get the same error as mentioned above.

We also see requests comming into the model on the azure side of things.

---

<div class="post-metadata">

**Author:** ![flalar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flalar/32/85777_2.png) [@flalar](https://discuss.elastic.co/u/flalar)\
**Post date:** [January 20, 2025, 5:54pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/6 "2025-01-20T17:54:56Z")

</div>

@jessgarson , so this was strange. As looking at some other settings and tried to anable this tech preview feature

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/8/4866e1a2f42bf7ac55c72f9f60886c55f419a193.png)

and suddenly things seem to be working as expected. When switching it of things stop working again. Is it a bug?

As this experimental feature is probably slowing things down a bit, we would prefer not to have it enabled.

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [January 21, 2025, 7:22pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/7 "2025-01-21T19:22:10Z")

</div>

Hi @flalar,

I apologize for not getting back to you sooner; I had yesterday off for a public holiday.

I suspect this was an intermittent issue. If you haven't already, it's worth filing a [bug report](https://github.com/elastic/kibana/issues). I appreciate the feedback you shared, too.

Best,

Jessica

---

<div class="post-metadata">

**Author:** ![flalar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flalar/32/85777_2.png) [@flalar](https://discuss.elastic.co/u/flalar)\
**Post date:** [February 18, 2025, 10:41pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/8 "2025-02-18T22:41:52Z")

</div>

Upgrading to 8.17.2 solved this issue. However there are more issues 😩

> [@Error when adding items to observability ai assistant knowledge base](https://discuss.elastic.co/t/error-when-adding-items-to-observability-ai-assistant-knowledge-base/374715):
>
> We recently upgraded from 8.14.3 to 8.17.2 to make full use of the \*\*AI Assistant, but we're running into an issue again. weary When trying to add items to the knowledge base via the Knowledge Base settings page, we get the following error: Error: exception Caused by: resource\_not\_found\_exception: Could not find trained model [obs\_ai\_assistant\_kb\_inference] Root causes: resource\_not\_found\_exception: Could not find trained model [obs\_ai\_assistant\_kb\_inference] at Object.onError (htt…

---

<div class="post-metadata">

**Author:** ![jessgarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jessgarson/32/129841_2.png) [@jessgarson](https://discuss.elastic.co/u/jessgarson)\
**Post date:** [February 19, 2025, 3:21pm UTC](https://discuss.elastic.co/t/ai-assistant-giving-errors/373285/9 "2025-02-19T15:21:07Z")

</div>

Thanks for following up, @flalar, and letting us know what resolved that part of the issue.
