Skip to content

Commit 487f4b0

Browse files
author
MasterSelects
committed
fix: normalize empty tool call content for hosted chat
1 parent 51cec03 commit 487f4b0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

functions/lib/providers/openai.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ export function normalizeHostedChatRequest(body: unknown): HostedChatRequest | n
113113
const toolCalls = normalizeToolCalls(message.tool_calls);
114114
if (toolCalls) {
115115
normalized.tool_calls = toolCalls;
116+
117+
if (typeof normalized.content !== 'string' || normalized.content.trim().length === 0) {
118+
normalized.content = 'Calling tools.';
119+
}
116120
}
117121

118122
if (typeof message.tool_call_id === 'string' && message.tool_call_id.trim()) {

0 commit comments

Comments
 (0)