web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / GPT4-Vision Connector
Power Apps
Unanswered

GPT4-Vision Connector

(0) ShareShare
ReportReport
Posted on by 4

 

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

 

Categories:

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard