-
-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cookbook: competitors matrix example for image extraction #346
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several improvements suggested.
Summary:
This PR adds a new example script that uses OpenAI's GPT-4 vision model to identify and categorize competitors from images, and saves the results in a JSON file.
Key points:
- New example script
competitors.py
added. - Uses OpenAI's GPT-4 vision model to identify competitors from images.
- Categorizes competitors by industry and extracts key features.
- Results are saved in a JSON file.
- Includes error handling for file reading and logging for process tracking.
Generated with ❤️ by ellipsis.dev
examples/vision/competitors.py
Outdated
competitor_list: List[Competitor] = Field( | ||
description="A dict of competitors where each key is an industry" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the 'competitor_list' field is misleading. It's not a dictionary but a list of 'Competitor' objects. Please update the description to accurately reflect the data structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description for the 'competitor_list' field is misleading. It's not a dictionary but a list of 'Competitor' objects. Please update the description to accurately reflect the data structure.
you are right mr ellipsis, will fix asap
wanna add a cookbook example? |
Yeah, will make one - I take it it should be under |
yup and make sure to add it to mkdocs.yaml |
will do |
@jxnl cookbook added + added to mkdocs fyi: will be OOO this week and without connection so will see any new messages next week |
docs/examples/extract_slides.md
Outdated
# Apply the patch to the OpenAI client | ||
# enables response_model keyword | ||
client = instructor.patch( | ||
OpenAI(mode=instructor.Mode.MD_JSON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenAI(mode=instructor.Mode.MD_JSON) | |
OpenAI(), mode=instructor.Mode.MD_JSON |
does this code run? lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also why is it slides and not competitors? This is a different example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
honestly it seemed that 'slides' was a better name because its more generic, i.e. this example is about extracting anything from a slide, not specifically competitors
I changed the name of the .py file to slides to make it symmetric, let me know if you agree
hey @jxnl just in case you didn't see it, I resolved your comments a few days ago - this should be ready to merge |
can you run ruff and i'll merge |
Ruff is passing |
No description provided.