muhammad121 commited on
Commit
9459b34
·
verified ·
1 Parent(s): fb8cdcd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -241,7 +241,7 @@ def prepare_messages(chunks_text):
241
  Returns:
242
  list: Messages formatted for OpenAI chat completion API
243
  """
244
- messages = [{"role": "system", "content": f"You are a helpful assistant. Use the following information to answer the user's question:\n\n{chunks_text} keep your answer concise and clear and complete and fast "}]
245
  for msg in st.session_state.messages[-10:]:
246
  messages.append({"role": msg["role"], "content": msg["content"]})
247
  return messages
@@ -261,7 +261,7 @@ def generate_ai_response(messages):
261
  model="gpt-4o-mini",
262
  messages=messages,
263
  temperature=0.7,
264
- max_tokens=300,
265
  )
266
  return response.choices[0].message.content
267
  except Exception as e:
@@ -312,7 +312,7 @@ def chat_page():
312
 
313
  Uses a hardcoded user_id for document access.
314
  """
315
- st.title("Tekrevol Freezones Agent")
316
 
317
  # Hardcoded user_id
318
  user_id = "670e5a5c-149f-4090-bae6-4c69e4cda540"
 
241
  Returns:
242
  list: Messages formatted for OpenAI chat completion API
243
  """
244
+ messages = [{"role": "system", "content": f"You are a helpful assistant. Use the following information to answer the user's question:\n\n{chunks_text} keep your answer clear and complete and fast "}]
245
  for msg in st.session_state.messages[-10:]:
246
  messages.append({"role": msg["role"], "content": msg["content"]})
247
  return messages
 
261
  model="gpt-4o-mini",
262
  messages=messages,
263
  temperature=0.7,
264
+ max_tokens=400,
265
  )
266
  return response.choices[0].message.content
267
  except Exception as e:
 
312
 
313
  Uses a hardcoded user_id for document access.
314
  """
315
+ st.title("StartSmart AI")
316
 
317
  # Hardcoded user_id
318
  user_id = "670e5a5c-149f-4090-bae6-4c69e4cda540"