mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Obs AI Assistant] Don't fail calls where messages have data (#191952)
In https://github.com/elastic/kibana/pull/191607, we fixed a bug around `strictKeysRt` not strictly checking object types in arrays. That exposed a bug in our `messageRt` type where we define `data` incorrectly, which means that any conversation that has data (as the result of some function calls) will fail with a 400. This PR corrects that mistake.
This commit is contained in:
parent
3c9198abeb
commit
448c9e1328
2 changed files with 4 additions and 4 deletions
|
@ -17,8 +17,6 @@ import {
|
|||
type StarterPrompt,
|
||||
} from '../../common/types';
|
||||
|
||||
const serializeableRt = t.any;
|
||||
|
||||
export const messageRt: t.Type<Message> = t.type({
|
||||
'@timestamp': t.string,
|
||||
message: t.intersection([
|
||||
|
@ -35,6 +33,7 @@ export const messageRt: t.Type<Message> = t.type({
|
|||
content: t.string,
|
||||
name: t.string,
|
||||
event: t.string,
|
||||
data: t.string,
|
||||
function_call: t.intersection([
|
||||
t.type({
|
||||
name: t.string,
|
||||
|
@ -45,8 +44,7 @@ export const messageRt: t.Type<Message> = t.type({
|
|||
]),
|
||||
}),
|
||||
t.partial({
|
||||
arguments: serializeableRt,
|
||||
data: serializeableRt,
|
||||
arguments: t.string,
|
||||
}),
|
||||
]),
|
||||
}),
|
||||
|
|
|
@ -54,6 +54,8 @@ export default function ApiTest({ getService }: FtrProviderContext) {
|
|||
message: {
|
||||
role: MessageRole.User,
|
||||
content: 'Good morning, bot!',
|
||||
// make sure it doesn't 400 on `data` being set
|
||||
data: '{}',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue