datasette / datasette-extract

Import unstructured data (text and images) into structured tables
Apache License 2.0
129 stars 3 forks source link

GPT-4 Vision supports functions now #19

Closed simonw closed 2 months ago

simonw commented 2 months ago

https://twitter.com/OpenAIDevs/status/1777769463258988634

GPT-4 Turbo with Vision is now generally available in the API. Vision requests can now also use JSON mode and function calling. https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4

simonw commented 2 months ago

This means I can get rid of this horrible hack:

https://github.com/datasette/datasette-extract/blob/7429965988761ee7ee7ef645e88cd97e7c419622/datasette_extract/__init__.py#L284-L318

simonw commented 2 months ago

It worked against my test image:

comedy-luau

[
  {
    "event_title": "Coastside Comedy Luau",
    "event_description": "Comedy event featuring Laurie Kilmartin, Ryan Goodcase, and Phil Griffiths, hosted by Marcus D. Includes Hawaiian buffet and welcome cocktail. Proceeds benefit Wilkinson School and Coastside Hope.",
    "event_date": "2022-05-06",
    "start_time": "18:00",
    "end_time": "22:00"
  }
]

CleanShot 2024-04-09 at 12 08 25@2x

simonw commented 2 months ago

Video demo: https://www.youtube.com/watch?v=g3NtJatmQR0

brianjking commented 2 months ago

Absolutely killing it, thank you, @simonw -- I've noticed some weird date issues with GPT-4 vision, wonder if that's what you saw in your demo video.