Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -386,7 +386,8 @@ class MultiModalRetriever:
|
|
| 386 |
self.text_retriever = text_retriever
|
| 387 |
self.clip_model = clip_model
|
| 388 |
self.clip_processor = clip_processor
|
| 389 |
-
|
|
|
|
| 390 |
|
| 391 |
def retrieve(self, query: str, domain: str) -> Dict[str, List]:
|
| 392 |
results = {
|
|
@@ -422,13 +423,12 @@ class ResearchWorkflow:
|
|
| 422 |
self.app = self.workflow.compile()
|
| 423 |
|
| 424 |
def _build_workflow(self) -> None:
|
| 425 |
-
#
|
| 426 |
self.workflow.add_node("ingest", self.ingest_query)
|
| 427 |
self.workflow.add_node("retrieve", self.retrieve_documents)
|
| 428 |
self.workflow.add_node("analyze", self.analyze_content)
|
| 429 |
self.workflow.add_node("validate", self.validate_output)
|
| 430 |
self.workflow.add_node("refine", self.refine_results)
|
| 431 |
-
# Set base edges
|
| 432 |
self.workflow.set_entry_point("ingest")
|
| 433 |
self.workflow.add_edge("ingest", "retrieve")
|
| 434 |
self.workflow.add_edge("retrieve", "analyze")
|
|
@@ -446,7 +446,7 @@ class ResearchWorkflow:
|
|
| 446 |
|
| 447 |
def ingest_query(self, state: AgentState) -> Dict:
|
| 448 |
"""
|
| 449 |
-
Ingests the research query and initializes
|
| 450 |
"""
|
| 451 |
try:
|
| 452 |
query = state["messages"][-1].content
|
|
@@ -804,10 +804,10 @@ qdm.create_image_collection([
|
|
| 804 |
# ------------------------------
|
| 805 |
# Execute the Application
|
| 806 |
# ------------------------------
|
| 807 |
-
class
|
| 808 |
"""Extended with domain adaptability, collaboration, and graph visualization."""
|
| 809 |
def _build_main_interface(self) -> None:
|
| 810 |
super()._build_main_interface()
|
| 811 |
|
| 812 |
if __name__ == "__main__":
|
| 813 |
-
|
|
|
|
| 386 |
self.text_retriever = text_retriever
|
| 387 |
self.clip_model = clip_model
|
| 388 |
self.clip_processor = clip_processor
|
| 389 |
+
# Provide required positional arguments: name and description
|
| 390 |
+
self.code_retriever = create_retriever_tool([], "Code Retriever", "Retriever for code snippets")
|
| 391 |
|
| 392 |
def retrieve(self, query: str, domain: str) -> Dict[str, List]:
|
| 393 |
results = {
|
|
|
|
| 423 |
self.app = self.workflow.compile()
|
| 424 |
|
| 425 |
def _build_workflow(self) -> None:
|
| 426 |
+
# Base workflow nodes
|
| 427 |
self.workflow.add_node("ingest", self.ingest_query)
|
| 428 |
self.workflow.add_node("retrieve", self.retrieve_documents)
|
| 429 |
self.workflow.add_node("analyze", self.analyze_content)
|
| 430 |
self.workflow.add_node("validate", self.validate_output)
|
| 431 |
self.workflow.add_node("refine", self.refine_results)
|
|
|
|
| 432 |
self.workflow.set_entry_point("ingest")
|
| 433 |
self.workflow.add_edge("ingest", "retrieve")
|
| 434 |
self.workflow.add_edge("retrieve", "analyze")
|
|
|
|
| 446 |
|
| 447 |
def ingest_query(self, state: AgentState) -> Dict:
|
| 448 |
"""
|
| 449 |
+
Ingests the research query and initializes context with query, domain, refinement counter, and history.
|
| 450 |
"""
|
| 451 |
try:
|
| 452 |
query = state["messages"][-1].content
|
|
|
|
| 804 |
# ------------------------------
|
| 805 |
# Execute the Application
|
| 806 |
# ------------------------------
|
| 807 |
+
class ResearchInterfaceExtended(ResearchInterface):
|
| 808 |
"""Extended with domain adaptability, collaboration, and graph visualization."""
|
| 809 |
def _build_main_interface(self) -> None:
|
| 810 |
super()._build_main_interface()
|
| 811 |
|
| 812 |
if __name__ == "__main__":
|
| 813 |
+
ResearchInterfaceExtended()
|