Execute a research session. Args: session_id: ID of the session to run status_callback: Optional callback for state change notifications Signature: (session_id, old_state, new_state) -> None Returns: Current se
(self,
session_id: str,
status_callback: Optional[Callable[[str, str, str], None]] = None)
| 163 | return session_id |
| 164 | |
| 165 | async def run_session(self, |
| 166 | session_id: str, |
| 167 | status_callback: Optional[Callable[[str, str, str], None]] = None) -> Dict[str, Any]: |
| 168 | """ |
| 169 | Execute a research session. |
| 170 | |
| 171 | Args: |
| 172 | session_id: ID of the session to run |
| 173 | status_callback: Optional callback for state change notifications |
| 174 | Signature: (session_id, old_state, new_state) -> None |
| 175 | |
| 176 | Returns: |
| 177 | Current session status |
| 178 | |
| 179 | Raises: |
| 180 | RuntimeError: If system is not ready |
| 181 | """ |
| 182 | self._ensure_system_ready() |
| 183 | |
| 184 | # Create state change handler |
| 185 | async def on_state_change(session, old_state, new_state): |
| 186 | self._update_session_tracking(session_id, new_state.value) |
| 187 | |
| 188 | if status_callback: |
| 189 | try: |
| 190 | await status_callback(session_id, old_state.value, new_state.value) |
| 191 | except Exception as e: |
| 192 | logger.error(f"Error in status callback: {str(e)}") |
| 193 | |
| 194 | # Execute session |
| 195 | await self.orchestration_agent.run_session( |
| 196 | session_id=session_id, |
| 197 | on_state_change=on_state_change |
| 198 | ) |
| 199 | |
| 200 | return await self.get_session_status(session_id) |
| 201 | |
| 202 | async def add_feedback(self, |
| 203 | session_id: str, |
no test coverage detected