Spanicin commited on
Commit
33127dd
·
verified ·
1 Parent(s): 11b9455

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 into a single sentence with no more than 15 words, keeping it concise and accurate, without any hallucination."},
169
- {"role": "user", "content": f"Please summarize the following paragraph into one sentence with 15 words or fewer: {text_prompt}"},
170
  ],
171
- max_tokens = 100, # 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 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