Akash Mahata commited on
Commit
dd29d8d
·
verified ·
1 Parent(s): 4586819

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -9,8 +9,17 @@ llm = ChatOpenAI(
9
  temperature=0.5
10
  )
11
 
 
 
 
 
 
 
 
 
 
12
  def get_text_response(message, history):
13
- conversation = ""
14
 
15
  for user_msg, bot_msg in history:
16
  conversation += f"User: {user_msg}\nAssistant: {bot_msg}\n"
 
9
  temperature=0.5
10
  )
11
 
12
+ SYSTEM_PROMPT = """
13
+ You are a friendly and helpful AI assistant.
14
+
15
+ Rules:
16
+ - If the user says only greetings like "hi", "hello", "hey", respond in a warm and professional way.
17
+ - Your greeting should be: "Hi! I'm your AI assistant. How can I help you today?"
18
+ - Keep responses clear, polite, and beginner-friendly.
19
+ """
20
+
21
  def get_text_response(message, history):
22
+ conversation = SYSTEM_PROMPT + "\n\n"
23
 
24
  for user_msg, bot_msg in history:
25
  conversation += f"User: {user_msg}\nAssistant: {bot_msg}\n"