Update app.py
Browse files
app.py
CHANGED
@@ -27,13 +27,14 @@ def summarize_text(contents, OPENAI_API_KEY):
|
|
27 |
|
28 |
response = openai.ChatCompletion.create(
|
29 |
model="gpt-4-turbo-preview", # Corrected engine identifier
|
30 |
-
headers = {
|
31 |
-
"Content-Type": "application/json",
|
32 |
-
"Authorization": f"Bearer {OPENAI_API_KEY}"}
|
33 |
messages=[
|
34 |
{"role": "system", "content": "You are a helpful assistant."},
|
35 |
{"role": "user", "content": f"Summarize this: {contents}"}
|
36 |
-
]
|
|
|
|
|
|
|
|
|
37 |
)
|
38 |
return response.choices[0].message['content'].strip()
|
39 |
# def summarize_text(contents):
|
|
|
27 |
|
28 |
response = openai.ChatCompletion.create(
|
29 |
model="gpt-4-turbo-preview", # Corrected engine identifier
|
|
|
|
|
|
|
30 |
messages=[
|
31 |
{"role": "system", "content": "You are a helpful assistant."},
|
32 |
{"role": "user", "content": f"Summarize this: {contents}"}
|
33 |
+
],
|
34 |
+
headers={
|
35 |
+
"Content-Type": "application/json",
|
36 |
+
"Authorization": f"Bearer {OPENAI_API_KEY}"
|
37 |
+
}
|
38 |
)
|
39 |
return response.choices[0].message['content'].strip()
|
40 |
# def summarize_text(contents):
|