import os
import requests
payload = {
"input_prompt": "Ok please analyze the image again. Please output all rows that contain a capital B",
"messages": [
{
"role": "user",
"content": "Please give me a table of the weeks corresponding to the B week for 2025",
},
{
"role": "assistant",
"content": 'Here is the table of weeks corresponding to the B week for the year 2025, based on the provided search results:\n\n| WK | ARRIVAL DATE |\n|----|--------------|\n| 1 | December 27, 2024 |\n| 7 | February 7, 2025 |\n| 13 | March 21, 2025 |\n| 25 | June 13, 2025 |\n\nThese weeks are marked with "B" for the year 2025 in the search results.',
},
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/a0adf460-566f-11ef-aa47-02420a0001be/Screenshot%202024-08-09%20at%209.18.49AM.png"
},
},
{
"text": "Files: Screenshot 2024-08-09 at 9.18.49AM.png\n\nPlease analyze this image and look at the rows of data. If the row contains a capital B , please add that row to a table. Please display the table.",
"type": "text",
},
],
},
{
"role": "assistant",
"content": 'Certainly! Here is the table with rows from the image that contain a capital "B":\n\n| WK | ARRIVAL DATE |\n|----|--------------|\n| 4 | January 19, 2024 |\n| 10 | March 1, 2024 |\n| 16 | April 12, 2024 |\n| 21 | May 17, 2024 |\n| 27 | June 28, 2024 |\n| 33 | August 9, 2024 |\n| 39 | September 20, 2024 |\n\nThese rows have the capital "B" marked in the table.',
},
{"role": "user", "content": "What about the Row that has November 15, 2024"},
{
"role": "assistant",
"content": 'The row that has November 15, 2024, from the provided image contains a capital "B". Here is the complete row:\n\n| WK | ARRIVAL DATE | A | B | C | D | E | F |\n|----|----------------|---|---|---|---|---|---|\n| 47 | November 15, 2024 | | B | | | | |\n\nThis row indicates that the week of November 15, 2024, is marked with a capital "B".',
},
],
}
response = requests.post(
"https://api.gooey.ai/v2/video-bots?example_id=2gjqiq6hji7e",
headers={
"Authorization": "bearer " + os.environ["GOOEY_API_KEY"],
},
json=payload,
)
assert response.ok, response.content
result = response.json()
print(response.status_code, result)