Update app.py
Browse files
app.py
CHANGED
@@ -25,11 +25,20 @@ def get_transcript(urls):
|
|
25 |
# Function to summarize text using OpenAI's API
|
26 |
def summarize_text(contents):
|
27 |
response = openai.ChatCompletion.create(
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
31 |
)
|
32 |
-
return response.choices[0].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
# Function to integrate all the functionalities
|
35 |
def summarize_youtube_videos(keyword):
|
|
|
25 |
# Function to summarize text using OpenAI's API
|
26 |
def summarize_text(contents):
|
27 |
response = openai.ChatCompletion.create(
|
28 |
+
model="gpt-3.5-turbo", # Corrected engine identifier
|
29 |
+
messages=[
|
30 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
31 |
+
{"role": "user", "content": f"Summarize this: {contents}"}
|
32 |
+
]
|
33 |
)
|
34 |
+
return response.choices[0].message['content'].strip()
|
35 |
+
# def summarize_text(contents):
|
36 |
+
# response = openai.ChatCompletion.create(
|
37 |
+
# engine="gpt-3.5-turbo",
|
38 |
+
# prompt=f"요약: {contents}",
|
39 |
+
# max_tokens=150
|
40 |
+
# )
|
41 |
+
# return response.choices[0].text.strip()
|
42 |
|
43 |
# Function to integrate all the functionalities
|
44 |
def summarize_youtube_videos(keyword):
|