Created
May 15, 2024 11:26
-
-
Save NazarS-MC/9b4ed818dbc24a3dabfaafdd71d44c87 to your computer and use it in GitHub Desktop.
Realtime presentation transcription and clear meeting summary using GPT4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
headers = { | |
"Content-Type": "application/json", | |
"Authorization": f"Bearer {openai.api_key}" | |
} | |
payload = { | |
"model": model, | |
"messages": [ | |
{ | |
"role": "system", | |
"content": [ | |
{ | |
"type": "text", | |
"text": system_prompt | |
} | |
] | |
}, | |
{ | |
"role": "user", | |
"content": [ | |
{ | |
"type": "image_url", | |
"image_url": { | |
"url": f"data:image/jpeg;base64,{base64_image}", | |
"detail": "high" | |
} | |
} | |
] | |
} | |
], | |
"max_tokens": 4096, | |
"temperature": 0, | |
"seed": 0 | |
} | |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload) | |
response_content = response.json()['choices'][0]['message']['content'] | |
print(response_content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment