Skip to content

Commit 049ec39

Browse files
committed
fix(azure-openai): guard optional attachment dataUrl in inline image part
PreparedProviderAttachment.dataUrl is now optional (large files carry a handle instead); azure-openai builds chat content inline and assigned it directly to a required url field, failing the production build's type check.
1 parent 0b2e3a8 commit 049ec39

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

apps/sim/providers/azure-openai/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async function executeChatCompletionsRequest(
113113
const parts: ChatCompletionContentPart[] = []
114114
if (message.content) parts.push({ type: 'text', text: message.content })
115115
for (const a of attachments) {
116-
parts.push({ type: 'image_url', image_url: { url: a.dataUrl } })
116+
parts.push({ type: 'image_url', image_url: { url: a.remoteUrl ?? a.dataUrl ?? '' } })
117117
}
118118
const { files: _files, ...rest } = message
119119
allMessages.push({ ...rest, content: parts } as ChatCompletionMessageParam)

0 commit comments

Comments
 (0)