Hi All,
Goal: The user uploads a UML / BPMN diagram (picture), and the app analyzes and evaluates it using AI mechanisms.
Question: Is there a way to invoke Python or JavaScript code from within Glide to perform image analysis (specifically using the gpt-4-vision-preview model)? Can Make/Zapier be used for this?
I tried using the AI Image2Text feature in Glide, but it doesn’t work well for me (by the way, which model does Glide use - from Google or OpenAI, and is there a way to customize the prompt used by Glide)?
Code:
from openai import OpenAI
api_key = ‘sk-…’
image_url = “https://cdn-images.visual-paradigm.com/tutorials/howtodrawsequencediagram_screenshots/23-final-uml-sequence-diagram.png”
client = OpenAI(api_key=api_key)
response = client.chat.completions.create(
model=“gpt-4-vision-preview”,
messages=[
{
“role”: “user”,
“content”: [
{“type”: “text”, “text”: “What does the diagram show - describe it in Polish and find any errors in it.”},
{
“type”: “image_url”,
“image_url”: {
“url”: image_url,
“detail”: “high”
},
},
],
}
],
max_tokens=700,
)
Best Regards,
Andrzej