From 19538ec67b43492fd2febaa0e216ce5e9fa25ed5 Mon Sep 17 00:00:00 2001 From: Rajtilak Bhattacharjee Date: Sat, 11 Nov 2023 11:07:51 +0530 Subject: [PATCH] refactor: update input handling and OpenAI endpoint - Updated input statements in main.py for improved user interaction. - Revised the OpenAI endpoint in open_ai_stuff.py to migrate to the latest OpenAI library version for enhanced functionality and compatibility. --- src/main.py | 4 ++-- src/utils/open_ai_stuff.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.py b/src/main.py index 19d86c3..a4a2e77 100644 --- a/src/main.py +++ b/src/main.py @@ -16,8 +16,8 @@ def main(): unique_id = uuid.uuid4() # (CONTENT) Generate scripts for top 3 comments from FIRST pinned post - name = input("Please enter the name of the Podcast") - desc = input("Please enter the description of the Podcast") + name = input("Please enter the name of the Podcast: ") + desc = input("Please enter the description of the Podcast: ") openai.organization = input("Please enter your OpenAI Org: ") openai.api_key = input("Please enter your OpenAI API key: ") eleven_labs_api_key = input("Please enter your ElevenLabs API key: ") diff --git a/src/utils/open_ai_stuff.py b/src/utils/open_ai_stuff.py index ad040c6..139c0f4 100644 --- a/src/utils/open_ai_stuff.py +++ b/src/utils/open_ai_stuff.py @@ -4,7 +4,7 @@ import openai def generate_response(system_prompt, user_prompt): - response = openai.ChatCompletion.create( + response = openai.chat.completions.create( model="gpt-4", messages=[ {