timeki commited on
Commit
58bf750
1 Parent(s): 40084ba

remove unused code

Browse files
climateqa/engine/chains/retrieve_documents.py CHANGED
@@ -258,7 +258,6 @@ async def retrieve_documents(state,config, vectorstore,reranker,llm,rerank_by_qu
258
  # Add to the list of docs
259
  docs.extend(docs_question)
260
  related_content.extend(images_question)
261
- # related_content=[]
262
  new_state = {"documents":docs, "related_contents": related_content,"remaining_questions":remaining_questions}
263
  return new_state
264
 
 
258
  # Add to the list of docs
259
  docs.extend(docs_question)
260
  related_content.extend(images_question)
 
261
  new_state = {"documents":docs, "related_contents": related_content,"remaining_questions":remaining_questions}
262
  return new_state
263
 
climateqa/engine/graph.py CHANGED
@@ -43,7 +43,6 @@ class GraphState(TypedDict):
43
  documents: List[Document]
44
  related_contents : Dict[str,Document]
45
  recommended_content : List[Document]
46
- # graphs_returned: Dict[str,str]
47
 
48
  def search(state): #TODO
49
  return state
@@ -108,16 +107,10 @@ def make_graph_agent(llm, vectorstore_ipcc, vectorstore_graphs, reranker, thresh
108
  workflow.add_node("answer_search", answer_search)
109
  workflow.add_node("transform_query", transform_query)
110
  workflow.add_node("translate_query", translate_query)
111
- # workflow.add_node("transform_query_ai", transform_query)
112
- # workflow.add_node("translate_query_ai", translate_query)
113
  workflow.add_node("answer_chitchat", answer_chitchat)
114
  workflow.add_node("chitchat_categorize_intent", chitchat_categorize_intent)
115
- # workflow.add_node("answer_ai_impact", answer_ai_impact)
116
  workflow.add_node("retrieve_graphs", retrieve_graphs)
117
  workflow.add_node("retrieve_graphs_chitchat", retrieve_graphs)
118
- # workflow.add_node("retrieve_graphs_ai", retrieve_graphs)
119
- # workflow.add_node("answer_rag_graph", answer_rag_graph)
120
- # workflow.add_node("answer_rag_graph_ai", answer_rag_graph)
121
  workflow.add_node("retrieve_documents", retrieve_documents)
122
  workflow.add_node("answer_rag", answer_rag)
123
  workflow.add_node("answer_rag_no_docs", answer_rag_no_docs)
@@ -161,27 +154,14 @@ def make_graph_agent(llm, vectorstore_ipcc, vectorstore_graphs, reranker, thresh
161
  )
162
 
163
  # Define the edges
164
- # workflow.add_edge("set_defaults", "categorize_intent")
165
  workflow.add_edge("translate_query", "transform_query")
166
- # workflow.add_edge("transform_query", "retrieve_graphs")
167
  workflow.add_edge("transform_query", "retrieve_documents")
168
 
169
- # workflow.add_edge("retrieve_graphs", "answer_rag_graph")
170
  workflow.add_edge("retrieve_graphs", END)
171
- # workflow.add_edge("retrieve_graphs", "retrieve_documents")
172
- # workflow.add_edge("answer_rag_graph", "retrieve_documents")
173
  workflow.add_edge("answer_rag", END)
174
  workflow.add_edge("answer_rag_no_docs", END)
175
  workflow.add_edge("answer_chitchat", "chitchat_categorize_intent")
176
- # workflow.add_edge("answer_chitchat", END)
177
- # workflow.add_edge("answer_ai_impact", END)
178
- # workflow.add_edge("retrieve_graphs_chitchat", END)
179
- # workflow.add_edge("answer_ai_impact", "translate_query_ai")
180
- # workflow.add_edge("translate_query_ai", "transform_query_ai")
181
- # workflow.add_edge("transform_query_ai", "retrieve_graphs_ai")
182
- # workflow.add_edge("retrieve_graphs_ai", "answer_rag_graph_ai")
183
- # workflow.add_edge("answer_rag_graph_ai", END)
184
- # workflow.add_edge("retrieve_graphs_ai", END)
185
 
186
  # Compile
187
  app = workflow.compile()
 
43
  documents: List[Document]
44
  related_contents : Dict[str,Document]
45
  recommended_content : List[Document]
 
46
 
47
  def search(state): #TODO
48
  return state
 
107
  workflow.add_node("answer_search", answer_search)
108
  workflow.add_node("transform_query", transform_query)
109
  workflow.add_node("translate_query", translate_query)
 
 
110
  workflow.add_node("answer_chitchat", answer_chitchat)
111
  workflow.add_node("chitchat_categorize_intent", chitchat_categorize_intent)
 
112
  workflow.add_node("retrieve_graphs", retrieve_graphs)
113
  workflow.add_node("retrieve_graphs_chitchat", retrieve_graphs)
 
 
 
114
  workflow.add_node("retrieve_documents", retrieve_documents)
115
  workflow.add_node("answer_rag", answer_rag)
116
  workflow.add_node("answer_rag_no_docs", answer_rag_no_docs)
 
154
  )
155
 
156
  # Define the edges
 
157
  workflow.add_edge("translate_query", "transform_query")
 
158
  workflow.add_edge("transform_query", "retrieve_documents")
159
 
 
160
  workflow.add_edge("retrieve_graphs", END)
 
 
161
  workflow.add_edge("answer_rag", END)
162
  workflow.add_edge("answer_rag_no_docs", END)
163
  workflow.add_edge("answer_chitchat", "chitchat_categorize_intent")
164
+
 
 
 
 
 
 
 
 
165
 
166
  # Compile
167
  app = workflow.compile()