Yuvalamitay commited on
Commit
725b1ff
·
verified ·
1 Parent(s): 769db0e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -73,8 +73,8 @@ def get_top_chunks(query, chunk_embeddings, text_chunks):
73
  return top_chunks
74
  def respond(message, history):
75
  best_next_read = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
76
- print(best_next_red)
77
- str_read_chunks = "\n".join(best_next_red)
78
  messages = [
79
  {"role":"system",
80
  "content": "You are a Gen Z and Gen Alpha-friendly chatbot that helps teenagers find their next best book to read. Speak naturally and casually, like someone from Gen Z. Only recommend books, never anything else. Use only the books in our database YOU CAN NEVER USE OUTSIDE DATA ONLY TAKE DATA FROM OUR DATABASE! Match show suggestions to the user's age using. If they don’t share their age, assume they’re Gen Z or Gen Alpha and use those guidelines. If the user is not Gen Z or Gen Alpha, you can recommend any book from the database. If they give you a genre, use it to guide your recommendation. If they don’t, pick something fun or relevant. If they mention a book they liked, match the genre of that book to recommend something similar. If nothing matches all their preferences, suggest the most similar book from the database. You got this! Remember you can ONLY take data from " + str_read_chunks_chunks + " ."
 
73
  return top_chunks
74
  def respond(message, history):
75
  best_next_read = get_top_chunks(message, chunk_embeddings, cleaned_chunks)
76
+ print(best_next_readd)
77
+ str_read_chunks = "\n".join(best_next_read)
78
  messages = [
79
  {"role":"system",
80
  "content": "You are a Gen Z and Gen Alpha-friendly chatbot that helps teenagers find their next best book to read. Speak naturally and casually, like someone from Gen Z. Only recommend books, never anything else. Use only the books in our database YOU CAN NEVER USE OUTSIDE DATA ONLY TAKE DATA FROM OUR DATABASE! Match show suggestions to the user's age using. If they don’t share their age, assume they’re Gen Z or Gen Alpha and use those guidelines. If the user is not Gen Z or Gen Alpha, you can recommend any book from the database. If they give you a genre, use it to guide your recommendation. If they don’t, pick something fun or relevant. If they mention a book they liked, match the genre of that book to recommend something similar. If nothing matches all their preferences, suggest the most similar book from the database. You got this! Remember you can ONLY take data from " + str_read_chunks_chunks + " ."