mgbam commited on
Commit
efa51c3
·
verified ·
1 Parent(s): 1193c1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -443,7 +443,6 @@ class EnhancedCognitiveProcessor(CognitiveProcessor):
443
  content = response.get('choices', [{}])[0].get('message', {}).get('content', '')
444
  node_id = self.knowledge_graph.create_node({"content": content}, "analysis")
445
  if self.knowledge_graph.node_counter > 1:
446
- # Create a relation between the previous node and the new node
447
  self.knowledge_graph.create_relation(node_id - 1, node_id, "evolution", strength=0.8)
448
 
449
  # ------------------------------
@@ -520,7 +519,6 @@ class MultiModalRetriever:
520
  inputs = self.clip_processor(text=query, return_tensors="pt")
521
  with torch.no_grad():
522
  _ = self.clip_model.get_text_features(**inputs)
523
- # Placeholder for image retrieval results
524
  return ["image_result_1.png", "image_result_2.png"]
525
 
526
  def _retrieve_code(self, query: str) -> List[str]:
@@ -563,13 +561,9 @@ class ResearchWorkflow:
563
  def ingest_query(self, state: AgentState) -> Dict:
564
  try:
565
  query = state["messages"][-1].content
566
- domain = state.get("domain", "Biomedical Research")
567
- new_context = {
568
- "raw_query": query,
569
- "domain": domain,
570
- "refine_count": 0,
571
- "refinement_history": []
572
- }
573
  logger.info(f"Query ingested. Domain: {domain}")
574
  return {
575
  "messages": [AIMessage(content="Query ingested successfully")],
 
443
  content = response.get('choices', [{}])[0].get('message', {}).get('content', '')
444
  node_id = self.knowledge_graph.create_node({"content": content}, "analysis")
445
  if self.knowledge_graph.node_counter > 1:
 
446
  self.knowledge_graph.create_relation(node_id - 1, node_id, "evolution", strength=0.8)
447
 
448
  # ------------------------------
 
519
  inputs = self.clip_processor(text=query, return_tensors="pt")
520
  with torch.no_grad():
521
  _ = self.clip_model.get_text_features(**inputs)
 
522
  return ["image_result_1.png", "image_result_2.png"]
523
 
524
  def _retrieve_code(self, query: str) -> List[str]:
 
561
  def ingest_query(self, state: AgentState) -> Dict:
562
  try:
563
  query = state["messages"][-1].content
564
+ # Retrieve the domain from the state's context (defaulting to Biomedical Research)
565
+ domain = state.get("context", {}).get("domain", "Biomedical Research")
566
+ new_context = {"raw_query": query, "domain": domain, "refine_count": 0, "refinement_history": []}
 
 
 
 
567
  logger.info(f"Query ingested. Domain: {domain}")
568
  return {
569
  "messages": [AIMessage(content="Query ingested successfully")],