I'm trying to build a connector to use OPENAI GPT4 Vision
From OA docs I should have:
curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4-turbo",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What’s in this image?"
}, #### <<<---
{ ### <<<<---
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikalk.jpg"
}
}
]
}
],
"max_tokens": 300
}'
This is my current parameters section from the swager schema:
parameters:
- name: body
in: body
required: false
schema:
type: object
properties:
model:
type: string
description: model
default: gpt-4-turbo
messages:
type: array
items:
type: object
required:
- role
- content
properties:
role:
type: string
default: user
content:
type: array
items:
type: object
required:
- type
- text
- image_url
properties:
type:
type: string
default: text
text:
type: string
example: 'My prompt....'
required:
- text
image_url:
type: object
required:
- url
properties:
url:
type: string
example: 'https://domain.com/image.jpeg'
max_tokens:
type: integer
example: 500
default: 500
But this produces a different structure from what the docs wants, where `content` should be an array with two objects.
curl -X 'POST' \
'https://api.openai.com/v1/chat/completions' \
-H 'accept: application/json' \
-H 'Authorization: Bearer aaa-bbbbb-cccc' \
-H 'Content-Type: application/json' \
-d '{
"model": "gpt-4-turbo",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "My prompt....",
?????????
"image_url": {
"url": "https://domain.com/image.jpeg"
}
}
]
}
],
"max_tokens": 500
}'
I've tried the "import from sample" and the outcomes is the same.
What do i need to change to make this work?
Thank you