mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[Inference Connector] Return an empty object for tool arguments if empty (#208253)
This commit is contained in:
parent
ee97316a6c
commit
02a2e054d8
1 changed files with 5 additions and 0 deletions
|
@ -102,6 +102,11 @@ export function chunksIntoMessage(obs$: Observable<UnifiedChatCompleteResponse>)
|
|||
if (concatenatedChunk.choices[0].message.content === '') {
|
||||
concatenatedChunk.choices[0].message.content = null;
|
||||
}
|
||||
concatenatedChunk.choices[0].message.tool_calls?.forEach((toolCall: any) => {
|
||||
if (toolCall.function?.arguments?.trim() === '') {
|
||||
toolCall.function.arguments = '{}';
|
||||
}
|
||||
});
|
||||
return concatenatedChunk;
|
||||
})
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue