cindywqng commited on
Commit
1f026bc
·
verified ·
1 Parent(s): 447bc45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -13
app.py CHANGED
@@ -67,7 +67,7 @@ def generate_response(user_query, relevant_segment):
67
  Generate a response emphasizing the bot's capability in providing chess information.
68
  """
69
  try:
70
- user_message = f"Here's the information on chess: {relevant_segment}"
71
 
72
  # Append user's message to messages list
73
  messages.append({"role": "user", "content": user_message})
@@ -99,29 +99,41 @@ def query_model(question):
99
  Process a question, find relevant information, and generate a response.
100
  """
101
  if question == "":
102
- return "Welcome to ChessBot! Ask me anything about chess rules, strategies, and terminology."
103
  relevant_segment = find_relevant_segment(question, segments)
104
  if not relevant_segment:
105
- return "Could not find specific information. Please refine your question."
106
  response = generate_response(question, relevant_segment)
107
  return response
108
 
109
  # Define the welcome message and specific topics the chatbot can provide information about
110
  welcome_message = """
111
- # ♟️ Welcome to ChessBot!
112
 
113
- ## Your AI-driven assistant for all chess-related queries. Created by SCHOLAR1, SCHOLAR2, and SCHOLAR3 of the 2024 Kode With Klossy CITY Camp.
114
  """
115
 
116
  topics = """
117
  ### Feel Free to ask me anything from the topics below!
118
- - Chess piece movements
119
- - Special moves
120
- - Game phases
121
- - Common strategies
122
- - Chess terminology
123
- - Famous games
124
- - Chess tactics
 
 
 
 
 
 
 
 
 
 
 
 
125
  """
126
 
127
  # Setup the Gradio Blocks interface with custom layout components
@@ -133,7 +145,7 @@ with gr.Blocks(theme='JohnSmith9982/small_and_pretty') as demo:
133
  with gr.Row():
134
  with gr.Column():
135
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
136
- answer = gr.Textbox(label="ChessBot Response", placeholder="ChessBot will respond here...", interactive=False, lines=10)
137
  submit_button = gr.Button("Submit")
138
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
139
 
 
67
  Generate a response emphasizing the bot's capability in providing chess information.
68
  """
69
  try:
70
+ user_message = f"Here's the information on your request: {relevant_segment}"
71
 
72
  # Append user's message to messages list
73
  messages.append({"role": "user", "content": user_message})
 
99
  Process a question, find relevant information, and generate a response.
100
  """
101
  if question == "":
102
+ return "Welcome to CalmConnect! Ask me anything about destressing strategies or student opportunities. Feel free to talk to our online therapist!"
103
  relevant_segment = find_relevant_segment(question, segments)
104
  if not relevant_segment:
105
+ return "Could not find specific information. Please refine your question or head to our resources page."
106
  response = generate_response(question, relevant_segment)
107
  return response
108
 
109
  # Define the welcome message and specific topics the chatbot can provide information about
110
  welcome_message = """
111
+ # ♟️ Welcome to CalmConnect!
112
 
113
+ ## Your AI-driven assistant for destressing and extracurricular queries. Created by Olivia W, Alice T, and Cindy W of the 2024 Kode With Klossy CITY Camp.
114
  """
115
 
116
  topics = """
117
  ### Feel Free to ask me anything from the topics below!
118
+ - Arts and Crafts
119
+ - Destressing strategies
120
+
121
+ ### Ask about the following extracurricular opportunity topics below
122
+ - Engineering
123
+ - Tech/Computer Science
124
+ - Research : STEM
125
+ - Finance
126
+ - Law / Political Science / Debate
127
+ - The Arts
128
+ - Business / Leadership
129
+ - Pyschology
130
+ - Medicine / Biology
131
+ - Literature / Writing
132
+ - College Prep
133
+ - Advocacy: Environment or Identity
134
+ - Study Abroad
135
+ - General (unsure of what you want to do)
136
+
137
  """
138
 
139
  # Setup the Gradio Blocks interface with custom layout components
 
145
  with gr.Row():
146
  with gr.Column():
147
  question = gr.Textbox(label="Your question", placeholder="What do you want to ask about?")
148
+ answer = gr.Textbox(label="CalmConnect Response", placeholder="CalmConnect will respond here...", interactive=False, lines=10)
149
  submit_button = gr.Button("Submit")
150
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
151