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

Community site session details

Session Id : 1d5QFhG1SVBbPt+aPKHotg
Power Apps - Connector Development
Unanswered

GPT4-Vision Connector

Like (0) ShareShare
ReportReport
Posted on 7 May 2024 10:35:16 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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Featured topics

Loading complete