From a0a064cb12a920bc6cd32f2f0e5eb9f942035171 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Sun, 12 Nov 2023 17:22:52 -0500 Subject: [PATCH] Fix minor API changes --- src/prompt_engineering/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/prompt_engineering/__init__.py b/src/prompt_engineering/__init__.py index 300e117..7a3c2b7 100644 --- a/src/prompt_engineering/__init__.py +++ b/src/prompt_engineering/__init__.py @@ -194,7 +194,7 @@ def generate_json_resume(cv_text, api_key, model="gpt-3.5-turbo"): ) try: - answer = response["choices"][0]["message"]["content"] + answer = response.choices[0].message.content answer = json.loads(answer) if prompt == BASICS_PROMPT and "basics" not in answer: @@ -224,7 +224,7 @@ def tailor_resume(cv_text, api_key, model="gpt-3.5-turbo"): ], ) - answer = response["choices"][0]["message"]["content"] + answer = response.choices[0].message.content return answer except Exception as e: print(e)