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 text
|
| 169 |
-
{"role": "user", "content": f"Please summarize the following paragraph: {text_prompt}"},
|
| 170 |
],
|
| 171 |
-
max_tokens = len(text_prompt)
|
| 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 text into a single sentence, keeping it concise and accurate, without any hallucination."},
|
| 169 |
+
{"role": "user", "content": f"Please summarize the following paragraph into one sentence: {text_prompt}"},
|
| 170 |
],
|
| 171 |
+
max_tokens = len(text_prompt), # Limit the response to a reasonable length for a summary
|
| 172 |
)
|
| 173 |
return response
|
| 174 |
|