Spaces:
Paused
Paused
Commit ·
b4edc2a
1
Parent(s): 1322f40
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,14 +46,6 @@ class QueueCallback(BaseCallbackHandler):
|
|
| 46 |
def on_llm_end(self, *args, **kwargs: any) -> None:
|
| 47 |
return self.q.empty()
|
| 48 |
|
| 49 |
-
# create retrieval tool
|
| 50 |
-
tool = create_retriever_tool(
|
| 51 |
-
retriever,
|
| 52 |
-
"search_markstrat",
|
| 53 |
-
"Searches and returns information about the MarkStrat simulation program."
|
| 54 |
-
)
|
| 55 |
-
tools = [tool]
|
| 56 |
-
|
| 57 |
system_message = SystemMessage(
|
| 58 |
content=(
|
| 59 |
"You are an AI bot marketing professor at a business school helping students understand how to play the markstrat simulation. For every question or comment compose a well-structured response to the user's question, using context and conversation information. Your tone of voice will be conversational and engaging, while still being to the point and direct. "
|
|
@@ -80,9 +72,17 @@ def predict(message, model_type):
|
|
| 80 |
q = Queue()
|
| 81 |
job_done = object()
|
| 82 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
# load existing index
|
| 84 |
-
|
| 85 |
-
|
| 86 |
|
| 87 |
# conversational retrieval agent component construction - memory, prompt template, agent, agent executor
|
| 88 |
# specifying LLM to use
|
|
|
|
| 46 |
def on_llm_end(self, *args, **kwargs: any) -> None:
|
| 47 |
return self.q.empty()
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
system_message = SystemMessage(
|
| 50 |
content=(
|
| 51 |
"You are an AI bot marketing professor at a business school helping students understand how to play the markstrat simulation. For every question or comment compose a well-structured response to the user's question, using context and conversation information. Your tone of voice will be conversational and engaging, while still being to the point and direct. "
|
|
|
|
| 72 |
q = Queue()
|
| 73 |
job_done = object()
|
| 74 |
|
| 75 |
+
# create retrieval tool
|
| 76 |
+
tool = create_retriever_tool(
|
| 77 |
+
retriever,
|
| 78 |
+
"search_markstrat",
|
| 79 |
+
"Searches and returns information about the MarkStrat simulation program."
|
| 80 |
+
)
|
| 81 |
+
tools = [tool]
|
| 82 |
+
|
| 83 |
# load existing index
|
| 84 |
+
vectorsearch = Pinecone.from_existing_index(index_name, embeddings)
|
| 85 |
+
retriever = vectorsearch.as_retriever()
|
| 86 |
|
| 87 |
# conversational retrieval agent component construction - memory, prompt template, agent, agent executor
|
| 88 |
# specifying LLM to use
|