Skip to content

Commit

Permalink
correctly support the image content format shape for sending images
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Jul 30, 2024
1 parent 2a83d30 commit 0b11e52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion openai/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ local content_format = types.string + types.array_of(types.one_of({
}),
types.shape({
type = "image_url",
image_url = types.string
image_url = types.string + types.partial({
url = types.string
})
})
}))
local test_message = types.one_of({
Expand Down
4 changes: 3 additions & 1 deletion openai/init.moon
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ empty = (types.nil + types.literal(cjson.null))\describe "nullable"

content_format = types.string + types.array_of types.one_of {
types.shape { type: "text", text: types.string }
types.shape { type: "image_url", image_url: types.string }
types.shape { type: "image_url", image_url: types.string + types.partial {
url: types.string
}}
}

test_message = types.one_of {
Expand Down

0 comments on commit 0b11e52

Please # to comment.