Skip to content

Commit 0b11e52

Browse files
committed
correctly support the image content format shape for sending images
1 parent 2a83d30 commit 0b11e52

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

openai/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ local content_format = types.string + types.array_of(types.one_of({
1313
}),
1414
types.shape({
1515
type = "image_url",
16-
image_url = types.string
16+
image_url = types.string + types.partial({
17+
url = types.string
18+
})
1719
})
1820
}))
1921
local test_message = types.one_of({

openai/init.moon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ empty = (types.nil + types.literal(cjson.null))\describe "nullable"
1313

1414
content_format = types.string + types.array_of types.one_of {
1515
types.shape { type: "text", text: types.string }
16-
types.shape { type: "image_url", image_url: types.string }
16+
types.shape { type: "image_url", image_url: types.string + types.partial {
17+
url: types.string
18+
}}
1719
}
1820

1921
test_message = types.one_of {

0 commit comments

Comments
 (0)