Spaces:
Runtime error
Runtime error
feat(add_deep_rishsearch): Add the graph and call functions for deep rish search
Browse files- Dockerfile +1 -0
- src/graph/state_vector_nodes.py +6 -4
Dockerfile
CHANGED
|
@@ -14,6 +14,7 @@ COPY requirements.txt ./
|
|
| 14 |
COPY src/ ./src/
|
| 15 |
|
| 16 |
RUN pip3 install -r requirements.txt
|
|
|
|
| 17 |
|
| 18 |
EXPOSE 8501
|
| 19 |
|
|
|
|
| 14 |
COPY src/ ./src/
|
| 15 |
|
| 16 |
RUN pip3 install -r requirements.txt
|
| 17 |
+
RUN pip3 install --upgrade transformers
|
| 18 |
|
| 19 |
EXPOSE 8501
|
| 20 |
|
src/graph/state_vector_nodes.py
CHANGED
|
@@ -164,16 +164,18 @@ class research_model:
|
|
| 164 |
for i,v in state['topic_kw'].items():
|
| 165 |
keywords.append(",".join(v))
|
| 166 |
kw_string += f" with keywords: {', '.join(keywords)}"
|
|
|
|
|
|
|
| 167 |
messages = [
|
| 168 |
SystemMessage(content= f"You are an AI assistant that helps users find information about the Sustainable Development Goal: {topic_string}.\
|
| 169 |
Your task is to answer questions related to this goal using the provided tools with toolNames: {self.tool_names}\
|
| 170 |
You will be provided with a list of questions to answer below: \
|
| 171 |
-
questions = {
|
| 172 |
|
| 173 |
#AIMessage(content="Using publications on Semantic Scholar and my own reference data, I will answer the questions related to the Sustainable Development Goal: %s." % topic),
|
| 174 |
-
SystemMessage(content=f"Search for recent papers on {kw_string} in {
|
| 175 |
-
SystemMessage(content=f"Search for recent news on {kw_string} in {
|
| 176 |
-
SystemMessage(content=f"Search the internet for webpages on {kw_string} in {
|
| 177 |
#HumanMessage(content="Please provide a comprehensive answer to the questions based on the information gathered from the tools.")
|
| 178 |
]
|
| 179 |
state['messages'] = messages
|
|
|
|
| 164 |
for i,v in state['topic_kw'].items():
|
| 165 |
keywords.append(",".join(v))
|
| 166 |
kw_string += f" with keywords: {', '.join(keywords)}"
|
| 167 |
+
questions=state["questions"]
|
| 168 |
+
country=state['country']
|
| 169 |
messages = [
|
| 170 |
SystemMessage(content= f"You are an AI assistant that helps users find information about the Sustainable Development Goal: {topic_string}.\
|
| 171 |
Your task is to answer questions related to this goal using the provided tools with toolNames: {self.tool_names}\
|
| 172 |
You will be provided with a list of questions to answer below: \
|
| 173 |
+
questions = {questions} "),
|
| 174 |
|
| 175 |
#AIMessage(content="Using publications on Semantic Scholar and my own reference data, I will answer the questions related to the Sustainable Development Goal: %s." % topic),
|
| 176 |
+
SystemMessage(content=f"Search for recent papers on {kw_string} in {country}."),
|
| 177 |
+
SystemMessage(content=f"Search for recent news on {kw_string} in {country}."),
|
| 178 |
+
SystemMessage(content=f"Search the internet for webpages on {kw_string} in {country}."),
|
| 179 |
#HumanMessage(content="Please provide a comprehensive answer to the questions based on the information gathered from the tools.")
|
| 180 |
]
|
| 181 |
state['messages'] = messages
|