Open
Description
Thank you for your great component.
Following is an error message wehn I using function call in Azure ChatGPT 4o recently.
Missing parameter 'tool_call_id': messages with role 'tool' must have a 'tool_call_id'
Here my suggestion to resolve the issue and kindly help to resolve it.
unit OpenAI.Chat;
function TChatParams.Messages(const Value: TArray<TChatMessageBuild>): TChatParams;
begin
Items := TJSONArray.Create;
try
for Item in Value do
begin
JSON := TJSONObject.Create;
JSON.AddPair('role', Item.Role.ToString);
.
.
//add "tool_call_id" values
if not Item.ToolCallId.IsEmpty then
JSON.AddPair('tool_call_id', Item.ToolCallId);
.
.
finally
end;
end;
Metadata
Metadata
Assignees
Labels
No labels