Skip to content

[Obs AI Assistant][Bug] Display results and Visualize query actions on an ES|QL query doesn't work with Bedrock #214005

@viduni94

Description

@viduni94

When an ES|QL is generated, we present 2 options

  • Visualize Query
  • Display Results

None of these options work as expected with Bedrock and it throws a 400 error. Sometimes it displays the result, but still throws an error.

Error:

Encountered error in Bedrock stream of type validationException messages.8: Did not find 1 `tool_result` block(s) at the beginning of this message. Messages following `tool_use` blocks must begin with a matching number of `tool_result` blocks.

Possible cause:
Sending a tool call in an assistant message without the corresponding tool response in the next message

Screen.Recording.2025-03-11.at.4.08.50.PM.mov

LoC:

case ChatActionClickType.executeEsqlQuery:
next(
messages.concat({
'@timestamp': new Date().toISOString(),
message: {
role: MessageRole.Assistant,
content: '',
function_call: {
name: 'execute_query',
arguments: JSON.stringify({
query: payload.query,
}),
trigger: MessageRole.User,
},
},
})
);
break;

Metadata

Metadata

Assignees

Labels

Team:Obs AI AssistantObservability AI AssistantbugFixes for quality problems that affect the customer experience

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions