Spaces:
Paused
Paused
Update backend.py
Browse files- backend.py +9 -6
backend.py
CHANGED
|
@@ -217,12 +217,15 @@ def initialize_qa_system(_vector_store):
|
|
| 217 |
api_key=os.environ.get("OPENAI_API_KEY"),
|
| 218 |
)
|
| 219 |
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
# Define the tools
|
| 228 |
tools = [
|
|
|
|
| 217 |
api_key=os.environ.get("OPENAI_API_KEY"),
|
| 218 |
)
|
| 219 |
|
| 220 |
+
# Define the prompt template (ADD agent_scratchpad)
|
| 221 |
+
prompt = ChatPromptTemplate.from_messages(
|
| 222 |
+
[
|
| 223 |
+
("system", "You are a helpful assistant"),
|
| 224 |
+
MessagesPlaceholder(variable_name="chat_history"),
|
| 225 |
+
("human", "{input}"),
|
| 226 |
+
MessagesPlaceholder(variable_name="agent_scratchpad"),
|
| 227 |
+
]
|
| 228 |
+
)
|
| 229 |
|
| 230 |
# Define the tools
|
| 231 |
tools = [
|