Adrian Cowham commited on
Commit
8a6fff6
1 Parent(s): e5724fd

adjusted prompt and now using gpt-4

Browse files
Files changed (1) hide show
  1. src/app.py +10 -8
src/app.py CHANGED
@@ -18,20 +18,22 @@ from src.core.parsing import read_file
18
  VECTOR_STORE = "faiss"
19
  MODEL = "openai"
20
  EMBEDDING = "openai"
21
- MODEL = "gpt-3.5-turbo-16k"
22
  K = 5
23
  USE_VERBOSE = True
24
  API_KEY = os.environ["OPENAI_API_KEY"]
 
 
 
 
25
  system_template = """
26
- You are a chatbot, able to have normal interactions as well as answer questions about the 'Croatia', by Insight Guies.
27
- The context below contains excerpts from the book 'Croatia,' by Insight Guides, use this information to respond to the user's input.
28
- It's important that you do not use prior knowledge when responding, you must only use the information provided in the context.
29
- If there is not enough information in the context to formulate a response, you must respond with
30
  "I'm sorry, but I can't find the answer to your question in, the book Croatia by Insight Guides."
31
 
32
- Begin context:
33
  {context}
34
- End context.
35
 
36
  {chat_history}
37
  """
@@ -90,7 +92,7 @@ def predict(message):
90
  memory=memory,
91
  verbose=USE_VERBOSE,
92
  combine_docs_chain_kwargs={"prompt": qa_prompt})
93
- chain.rephrase_question = False
94
  lock = Lock()
95
  lock.acquire()
96
  try:
 
18
  VECTOR_STORE = "faiss"
19
  MODEL = "openai"
20
  EMBEDDING = "openai"
21
+ MODEL = "gpt-4"
22
  K = 5
23
  USE_VERBOSE = True
24
  API_KEY = os.environ["OPENAI_API_KEY"]
25
+ # , able to have normal interactions as well as answer questions about the 'Croatia', by Insight Guies.
26
+ #The context below contains excerpts from the book 'Croatia,' by Insight Guides
27
+ # If there is not enough information in the context to formulate a response, you must respond with
28
+ # Do not to use prior knowledge when responding, you must only use the information provided in the context.
29
  system_template = """
30
+ You are an honest and helpful AI travel assistant. Your customer is talking to you about traveling to Croatia.
31
+ Use the context below to respond to your customer.
32
+ If the context does not contain enough information to formulate a response, you must respond with:
 
33
  "I'm sorry, but I can't find the answer to your question in, the book Croatia by Insight Guides."
34
 
35
+ Context:
36
  {context}
 
37
 
38
  {chat_history}
39
  """
 
92
  memory=memory,
93
  verbose=USE_VERBOSE,
94
  combine_docs_chain_kwargs={"prompt": qa_prompt})
95
+ chain.rephrase_question = True
96
  lock = Lock()
97
  lock.acquire()
98
  try: