Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Connector Development
Unanswered

GPT4-Vision Connector

(0) ShareShare
ReportReport
Posted on by 2

 

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

 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics