-
-
Notifications
You must be signed in to change notification settings - Fork 775
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: Add tts / text-based recipe import feature #4561
base: mealie-next
Are you sure you want to change the base?
feat: Add tts / text-based recipe import feature #4561
Conversation
• 🎯 Add new endpoints for text-based recipe creation • 🔍 Implement OpenAI integration for recipe parsing • 🌐 Add language translation support • 🏷️ Add new translation keys • ♻️ Refactor OpenAI service for better text handling • 🐛 Fix model configuration for OpenAI API • 📝 Update prompts for better recipe extraction • 🚨 Add proper error handling and validation
✨ Allow reasonable interpretation of ambiguous text 🎯 Focus on practical usability over strict formatting
Hey, thanks for your PR. |
Thanks, didn't get the part with the PR naming and somehow also overlooked the poetry.lock file. Is there anything else - would you like me to delete the german translation file as well? |
Yeah, you should only include the english base translation. |
Sorry, I must admit my git skills aren't advanced enough to remove the poetry.lock and translation files from the existing commits. I apologize for including these files in the first place - I should have been more careful. Would you be able to guide me through the process, or would it be better to close this PR and create a new one with just the feature-related changes? |
I think this sould revert it to the state in main |
in view of #4582 i approve this PR |
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.
Love this PR! I think this adds a ton of accessibility to creating recipes, and makes things easier for "weird" imports from unstructured sources (like a text document or similar).
A few comments, but nothing major. Other than those, if you could write a test for this that would be great. We don't want to actually call an OpenAI endpoint for the tests so you'll need to mock a response; you can check out the "create from image" test. If you run into any issues let me know, happy to jump in and write the test myself as well.
The create from image test: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/integration_tests/user_recipe_tests/test_recipe_create_from_image.py
{ | ||
// just textarea dump voice actived icon | ||
icon: $globals.icons.text, |
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.
{ | |
// just textarea dump voice actived icon | |
icon: $globals.icons.text, | |
{ | |
icon: $globals.icons.text, |
message += f" Please translate the recipe to {translate_language}." | ||
|
||
try: | ||
# Explizit das model und response_format setzen |
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.
# Explizit das model und response_format setzen | |
# Explicitly set the model and response_format |
</v-row> | ||
</v-container> | ||
</v-card-text> | ||
<v-card-actions v-if="recipeText"> |
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.
Instead of hiding this, can we disable the create button? It's a bit jarring to see it pop in and out. Something like:
<BaseButton :disabled="!recipeText" ... />
<p v-if="loading" class="mb-0"> | ||
{{ $t('recipe.please-wait-processing') }} | ||
</p> |
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.
You can probably get rid of this since the submit button already indicates that it's loading
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.
did everything
is there anything left to do for the pr? |
Hey there! Sorry for the delay, been swamped with the holidays. Once I get the chance I'll take a look and approve if it's good to go or add some more feedback. Appreciate your patience! |
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.
It looks like some of my feedback got marked as resolved, but wasn't addressed. If you could take a look at those that would be great. I went and marked the ones not addressed as unresolved above
What type of PR is this?
What this PR does / why we need it:
This PR introduces a new text-based recipe import feature using OpenAI's API to automatically parse and structure recipe content. This allows users to paste in plain text recipes and have them automatically formatted into Mealie's recipe structure, with optional translation support.
Changes include:
/api/recipes/create/text
endpoint for text-based recipe creationrecipe_service.py
: Addcreate_from_text
andbuild_recipe_from_text
methodsThe changes make recipe import more accessible by allowing users to simply paste text / use tts rather than requiring structured input or image uploads.
Special notes for your reviewer:
OPENAI_ENABLED
setting to be trueCurrent Limitations:
Testing
Manual testing has been performed with:
TODO: