-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
feat: Parse and convert units using openAI #4508
base: mealie-next
Are you sure you want to change the base?
Conversation
prompt: I am Dutch so use imperial. You can approximate units like cups and depending on the ingredient use liters or grams. Obviously, ml should be used for ingredients that are liquid and grams for ingredients that are solid. Teaspoons and pinches you can keep the same. You may also convert inches to cm
Would you be able to share some screenshots of the UI? I think that will help others review. |
Sure! @michael-genson Here are some screenshots This is the standard recipe just after it has been imported: This is the view of the parser with the original openAI integration: |
Examples before and after. The before are withouth any parsing, the second are with the parsing and conversion. 4 tablespoons toasted sesame oil ======= 60 milliliters sesame oil 680 grams salmon ============= 3 tablespoons honey ========== 45 milliliters honey |
can you please add language translation for recipes using either local whisper or openai API? |
I see some inaccuracies & missing info between the original and the converted recipe. For example:
|
|
Sorry it took so long to get to this! In general I like this. Have you considered merging this with the OpenAI parser logic, rather than having it be its own separate prompt? Something like "you may be asked to translate/convert units..." and adding a param. That way we're not duplicating prompts. I did something similar with the image parsing prompt. |
@michael-genson I have considered this and I was playing around with it but removed it later. So it's funny that you bring it up. I had something like you suggested in the beginning but when the prompt got bigger I separated them. I figured that a longer prompt would perform worse., but did not test it. I'll try to combine the prompts this weekend |
Ah okay, if you're getting better results/small requests from keeping it separate that's fine. More of just something to consider. I'll give it a proper look over in the next few days, but overall looks good! |
This PR is stale because it has been open 45 days with no activity. |
Looks like there are some failing tests on this one |
What type of PR is this?
What this PR does / why we need it:
It adds some new routes which allow you to parse the ingredients and convert them using openAI. The code is the same as the parsing but with some additions to the prompt. The results from openAI (at least in my testing) were really great.
Which issue(s) this PR fixes:
#2731
Special notes for your reviewer:
I do not have a translation for the button and I am maybe not happy with the place of the button in the UI (maybe the mealie team has some insights). I also do not have a testing function for this, since I am also not very experienced in this field.
Testing
I imported many recipes and kept fine-tuning the prompt