mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-10 09:53:14 -05:00
feat: OpenAI Custom Headers/Params and Debug Page (#4227)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
@@ -487,7 +487,13 @@ class OpenAIRecipeService(RecipeServiceBase):
|
||||
if translate_language:
|
||||
message += f" Please translate the recipe to {translate_language}."
|
||||
|
||||
response = await openai_service.get_response(prompt, message, images=openai_images, force_json_response=True)
|
||||
try:
|
||||
response = await openai_service.get_response(
|
||||
prompt, message, images=openai_images, force_json_response=True
|
||||
)
|
||||
except Exception as e:
|
||||
raise Exception("Failed to call OpenAI services") from e
|
||||
|
||||
try:
|
||||
openai_recipe = OpenAIRecipe.parse_openai_response(response)
|
||||
recipe = self._convert_recipe(openai_recipe)
|
||||
|
||||
Reference in New Issue
Block a user