JessicaL commited on
Commit
f966098
·
verified ·
1 Parent(s): ad9c0e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -60,11 +60,11 @@ def find_relevant_segment(user_query, segments):
60
 
61
  def generate_response(user_query, relevant_segment):
62
  """
63
- Generate a response emphasizing the bot's capability in providing chess information.
64
  """
65
  try:
66
- system_message = "You are a chess chatbot specialized in providing information on chess rules, strategies, and terminology."
67
- user_message = f"Here's the information on chess: {relevant_segment}"
68
  messages = [
69
  {"role": "system", "content": system_message},
70
  {"role": "user", "content": user_message}
@@ -88,7 +88,7 @@ def query_model(question):
88
  Process a question, find relevant information, and generate a response.
89
  """
90
  if question == "":
91
- return "Welcome to ChessBot! Ask me anything about chess rules, strategies, and terminology."
92
  relevant_segment = find_relevant_segment(question, segments)
93
  if not relevant_segment:
94
  return "Could not find specific information. Please refine your question."
@@ -97,20 +97,19 @@ def query_model(question):
97
 
98
  # Define the welcome message and specific topics the chatbot can provide information about
99
  welcome_message = """
100
- # ♟️ Welcome to ChessBot!
101
 
102
- ## Your AI-driven assistant for all chess-related queries.
103
  """
104
 
105
  topics = """
106
  ### Feel Free to ask me anything from the topics below!
107
- - Chess piece movements
108
- - Special moves
109
- - Game phases
110
- - Common strategies
111
- - Chess terminology
112
- - Famous games
113
- - Chess tactics
114
  """
115
 
116
  # Setup the Gradio Blocks interface with custom layout components
 
60
 
61
  def generate_response(user_query, relevant_segment):
62
  """
63
+ Generate a response emphasizing the bot's capability in providing information about where to find access to local farm goods and farmers markets in New York City.
64
  """
65
  try:
66
+ system_message = "You are a chatbot specialized in providing information on where people living in New York City can find access to farmers markets and local produce, as well as when they are in session and all other necessary information for the user in regards to access to locally grown foods".
67
+ user_message = f"Here's the information on local farmers markets in New York City: {relevant_segment}"
68
  messages = [
69
  {"role": "system", "content": system_message},
70
  {"role": "user", "content": user_message}
 
88
  Process a question, find relevant information, and generate a response.
89
  """
90
  if question == "":
91
+ return "Welcome to NYC HEALTHY TOGETHER! Ask me anything about where to find the nearest farmers market, hours of operation, and information on all seasonal farmers markets."
92
  relevant_segment = find_relevant_segment(question, segments)
93
  if not relevant_segment:
94
  return "Could not find specific information. Please refine your question."
 
97
 
98
  # Define the welcome message and specific topics the chatbot can provide information about
99
  welcome_message = """
100
+ # ♟️ Welcome to NYC HEALTHY TOGETHER!
101
 
102
+ ## Your AI-driven assistant for all healthy food in NYC-related queries.
103
  """
104
 
105
  topics = """
106
  ### Feel Free to ask me anything from the topics below!
107
+ - Farmers markets in your borough
108
+ - Farmers markets outside of the five boroughs
109
+ - Government resources to help finance your healthy foods purchases
110
+ - WIC program and farmers markets
111
+ - Using SNAP at farmers markets
112
+ - Local events on healthy foods
 
113
  """
114
 
115
  # Setup the Gradio Blocks interface with custom layout components