Update app.py
Browse files
app.py
CHANGED
@@ -165,10 +165,10 @@ def openai_chat_avatar(text_prompt):
|
|
165 |
response = client.chat.completions.create(
|
166 |
model="gpt-4o-mini",
|
167 |
messages=[
|
168 |
-
{"role": "system", "content": "Summarize the following
|
169 |
-
{"role": "user", "content": f"Please summarize the following paragraph into one sentence with 15 words or fewer: {text_prompt}"},
|
170 |
],
|
171 |
-
max_tokens =
|
172 |
)
|
173 |
return response
|
174 |
|
|
|
165 |
response = client.chat.completions.create(
|
166 |
model="gpt-4o-mini",
|
167 |
messages=[
|
168 |
+
{"role": "system", "content": "Summarize the following paragraph into a complete and accurate single sentence with no more than 15 words. The summary should capture the gist of the paragraph and make sense."},
|
169 |
+
{"role": "user", "content": f"Please summarize the following paragraph into one sentence with 15 words or fewer, ensuring it makes sense and captures the gist: {text_prompt}"},
|
170 |
],
|
171 |
+
max_tokens = len(text_prompt), # Limit the response to a reasonable length for a summary
|
172 |
)
|
173 |
return response
|
174 |
|