Spanicin commited on
Commit
f8a87d0
·
verified ·
1 Parent(s): 3b13078

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 accurately and concisely. Avoid any hallucination and provide only the key points in a clear, concise manner."},
169
- {"role": "user", "content": f"Please summarize the following paragraph: {text_prompt}"},
170
  ],
171
- max_tokens = len(text_prompt) + 300, # Limit the response to a reasonable length for a summary
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