from packages.vision import Vision
from packages.gpt_chat import GPTChat
from PIL import Image
chat = GPTChat()
# set initial system message
chat.set_system_context('You are a helpful assistant')
# start conversation
chat.add_assistant('How can I help you today')
chat.add_user('Well I need you to check an image for me')
chat.add_assistance('Please upload the image for inspection and state your requirement')
chat.add_user([
'I would like you to tell me what is in the following image',
Image.open('image.png', 'r'),
])
# initialize vision
vision = Vision()
response = vision.query_gpt(chat, max_token=300)
response.choices[0].message.content
-
Notifications
You must be signed in to change notification settings - Fork 0
ucscode/Python-GPTQuery
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
An easy way to query open ai api with vision capability using python
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published