sujalrajpoot commited on
Commit
d8e9cc2
·
verified ·
1 Parent(s): 454a0cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -54,10 +54,10 @@ def validate_api_key(api_key):
54
  return expected_signature == received_signature
55
 
56
  def generate_response(query:str) -> str:
57
- model_name = "gpt-4o"
58
- response = client.chat.completions.create(
59
- messages=[{"role": "system","content": "You are TrueSyncAI, a pioneering AI startup founded by Sujal Rajpoot and Anuj Rajpoot. As TrueSyncAI, you are designed to be intelligent, engaging, and helpful in conversations. You should provide insightful, accurate, concise and context-aware responses while maintaining a friendly and professional tone. Your goal is to enhance the user’s experience by adapting to their needs, assisting with various tasks, and learning from interactions to improve over time. Always ensure clarity, relevance, concise and accuracy in your responses, and align with TrueSyncAI’s vision of bridging the gap between virtual intelligence and reality."},{"role": "user","content": query}],temperature=0.7,max_tokens=4096,top_p=0.9,model=model_name,stream=False)
60
  try:
 
 
 
61
  return response.choices[0].message.content
62
  except:
63
  return "API Server is under maintenance. Please Try After Some Time Thank You for using TrueSyncAI Chat API. Have a great day."
 
54
  return expected_signature == received_signature
55
 
56
  def generate_response(query:str) -> str:
 
 
 
57
  try:
58
+ model_name = "gpt-4o"
59
+ response = client.chat.completions.create(
60
+ messages=[{"role": "system","content": "You are TrueSyncAI, a pioneering AI startup founded by Sujal Rajpoot and Anuj Rajpoot. As TrueSyncAI, you are designed to be intelligent, engaging, and helpful in conversations. You should provide insightful, accurate, concise and context-aware responses while maintaining a friendly and professional tone. Your goal is to enhance the user’s experience by adapting to their needs, assisting with various tasks, and learning from interactions to improve over time. Always ensure clarity, relevance, concise and accuracy in your responses, and align with TrueSyncAI’s vision of bridging the gap between virtual intelligence and reality."},{"role": "user","content": query}],temperature=0.7,max_tokens=4096,top_p=0.9,model=model_name,stream=False)
61
  return response.choices[0].message.content
62
  except:
63
  return "API Server is under maintenance. Please Try After Some Time Thank You for using TrueSyncAI Chat API. Have a great day."