add calling model name
Browse files
app.py
CHANGED
|
@@ -270,7 +270,7 @@ class VisualConsensusEngine:
|
|
| 270 |
})
|
| 271 |
time.sleep(1)
|
| 272 |
|
| 273 |
-
result = self._execute_research_function(function_name, arguments)
|
| 274 |
|
| 275 |
# Ensure result is a string
|
| 276 |
if not isinstance(result, str):
|
|
@@ -360,7 +360,7 @@ class VisualConsensusEngine:
|
|
| 360 |
return message.content or "Analysis completed with research integration."
|
| 361 |
|
| 362 |
|
| 363 |
-
def _execute_research_function(self, function_name: str, arguments: dict) -> str:
|
| 364 |
"""Execute research function with REAL-TIME visual feedback and progress indicators"""
|
| 365 |
|
| 366 |
query_param = arguments.get("query") or arguments.get("topic") or arguments.get("technology") or arguments.get("company")
|
|
@@ -439,14 +439,14 @@ class VisualConsensusEngine:
|
|
| 439 |
|
| 440 |
# Phase 3: Show research ACTUALLY complete (after execution)
|
| 441 |
if query_param:
|
| 442 |
-
self.show_research_complete(function_name, query_param, len(result))
|
| 443 |
|
| 444 |
return result
|
| 445 |
|
| 446 |
except Exception as e:
|
| 447 |
error_msg = str(e)
|
| 448 |
if query_param:
|
| 449 |
-
self.show_research_error(function_name, query_param, error_msg)
|
| 450 |
return f"Research function error: {error_msg}"
|
| 451 |
|
| 452 |
def show_research_starting(self, function: str, query: str):
|
|
@@ -494,7 +494,7 @@ class VisualConsensusEngine:
|
|
| 494 |
})
|
| 495 |
time.sleep(0.5)
|
| 496 |
|
| 497 |
-
def show_research_complete(self, function: str, query: str, result_length: int):
|
| 498 |
"""Show research ACTUALLY completed with data quality indicators"""
|
| 499 |
session = get_or_create_session_state(self.session_id)
|
| 500 |
current_state = session["roundtable_state"]
|
|
@@ -546,7 +546,7 @@ class VisualConsensusEngine:
|
|
| 546 |
self.update_visual_state({
|
| 547 |
"participants": participants,
|
| 548 |
"messages": all_messages,
|
| 549 |
-
"currentSpeaker":
|
| 550 |
"thinking": [],
|
| 551 |
"showBubbles": existing_bubbles + ["Research Agent"]
|
| 552 |
})
|
|
@@ -564,7 +564,7 @@ class VisualConsensusEngine:
|
|
| 564 |
}
|
| 565 |
return time_estimates.get(function_name, "1-3 minutes")
|
| 566 |
|
| 567 |
-
def show_research_error(self, function: str, query: str, error: str):
|
| 568 |
"""Show research error"""
|
| 569 |
session = get_or_create_session_state(self.session_id)
|
| 570 |
current_state = session["roundtable_state"]
|
|
@@ -590,7 +590,7 @@ class VisualConsensusEngine:
|
|
| 590 |
self.update_visual_state({
|
| 591 |
"participants": participants,
|
| 592 |
"messages": all_messages,
|
| 593 |
-
"currentSpeaker":
|
| 594 |
"thinking": [],
|
| 595 |
"showBubbles": existing_bubbles + ["Research Agent"]
|
| 596 |
})
|
|
|
|
| 270 |
})
|
| 271 |
time.sleep(1)
|
| 272 |
|
| 273 |
+
result = self._execute_research_function(function_name, arguments, calling_model_name)
|
| 274 |
|
| 275 |
# Ensure result is a string
|
| 276 |
if not isinstance(result, str):
|
|
|
|
| 360 |
return message.content or "Analysis completed with research integration."
|
| 361 |
|
| 362 |
|
| 363 |
+
def _execute_research_function(self, function_name: str, arguments: dict, requesting_model_name: str = None) -> str:
|
| 364 |
"""Execute research function with REAL-TIME visual feedback and progress indicators"""
|
| 365 |
|
| 366 |
query_param = arguments.get("query") or arguments.get("topic") or arguments.get("technology") or arguments.get("company")
|
|
|
|
| 439 |
|
| 440 |
# Phase 3: Show research ACTUALLY complete (after execution)
|
| 441 |
if query_param:
|
| 442 |
+
self.show_research_complete(function_name, query_param, len(result), requesting_model_name)
|
| 443 |
|
| 444 |
return result
|
| 445 |
|
| 446 |
except Exception as e:
|
| 447 |
error_msg = str(e)
|
| 448 |
if query_param:
|
| 449 |
+
self.show_research_error(function_name, query_param, error_msg, requesting_model_name)
|
| 450 |
return f"Research function error: {error_msg}"
|
| 451 |
|
| 452 |
def show_research_starting(self, function: str, query: str):
|
|
|
|
| 494 |
})
|
| 495 |
time.sleep(0.5)
|
| 496 |
|
| 497 |
+
def show_research_complete(self, function: str, query: str, result_length: int, requesting_model_name: str = None):
|
| 498 |
"""Show research ACTUALLY completed with data quality indicators"""
|
| 499 |
session = get_or_create_session_state(self.session_id)
|
| 500 |
current_state = session["roundtable_state"]
|
|
|
|
| 546 |
self.update_visual_state({
|
| 547 |
"participants": participants,
|
| 548 |
"messages": all_messages,
|
| 549 |
+
"currentSpeaker": requesting_model_name,
|
| 550 |
"thinking": [],
|
| 551 |
"showBubbles": existing_bubbles + ["Research Agent"]
|
| 552 |
})
|
|
|
|
| 564 |
}
|
| 565 |
return time_estimates.get(function_name, "1-3 minutes")
|
| 566 |
|
| 567 |
+
def show_research_error(self, function: str, query: str, error: str, requesting_model_name: str = None):
|
| 568 |
"""Show research error"""
|
| 569 |
session = get_or_create_session_state(self.session_id)
|
| 570 |
current_state = session["roundtable_state"]
|
|
|
|
| 590 |
self.update_visual_state({
|
| 591 |
"participants": participants,
|
| 592 |
"messages": all_messages,
|
| 593 |
+
"currentSpeaker": requesting_model_name,
|
| 594 |
"thinking": [],
|
| 595 |
"showBubbles": existing_bubbles + ["Research Agent"]
|
| 596 |
})
|