Use LLM/GPT for robust recipe import #3200
Closed
eikaramba
started this conversation in
Feature Request
Replies: 2 comments
-
this might also be used to solve #2916 (user also reported to have used gpt locally to import a bunch of text files) |
Beta Was this translation helpful? Give feedback.
0 replies
-
This was implemented a few months ago with the OpenAI integration! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Please provide a concise description of the problem that would be addressed by this feature.
I have the problem that not every recipe url can be imported correctly or even remotely at all.
Here are 2 examples:
Please provide a concise description of the feature that would resolve your issue.
My idea is to utilize GPT4 to let it parse any website text. First use beautifulsoup4 to parse the html output of the website and then use a prompt with the correct mealie schema to generate a valid json which can be used to create a new recipe.
I already have coded this for myself in a simple gradio application, which runs locally. it works very very good and GPT4 is able to not only generate the JSON flawlessly, but also intelligently removes duplicates from the recipe list, or even add ingredients which are maybe not in the separate ingredients list but were mentioned briefly in the text description. scary to see how good it works. sometimes it even translates the ingredients in the target language, but this can be customized. also it tries to parse any nutritional values from the website, which actually worked in every case i have thrown at it.
ideally i would like to have this within mealie. given that mealie is based on python, it should be quite easy to integrate. the user could enter his openai Token to use his/her credits. of course even better would be to use a local deployed llm (hard on sbc) or other services which are cheaper(https://groq.com)
here is a screenshot of my current working script. ignore the bottom part(which is just a simple exporter to an app i am using for grocery shopping)
Please consider and list out some caveats or tradeoffs made in your design decision
Costs for the user, although this can be completely optional. just a setting to enter the openai token, and if set, show the option within the importer dropdown or just add this as one of the possible intelligent parsers.
even more advanced would be to also give the gpt prompt a list of the food and unit items the user has in its database and tell gpt to use them if possible, but i am not sure if the context length is high enough for that to work. in the future however this will not be a problem as context length is growing with every new release
Additional Information
Beta Was this translation helpful? Give feedback.
All reactions