sherpa_ai.error_handling package#
Submodules#
sherpa_ai.error_handling.agent_error_handler module#
- class sherpa_ai.error_handling.agent_error_handler.AgentErrorHandler[source]#
Bases:
object
- error_map: Dict[BaseException, str]#
- run_with_error_handling(executable: Callable[[str], str], **kwargs)[source]#
Run the executable with error handling. If an error occurs, return the error message.
- Parameters:
executable (Callable[[str, List[Dict]], Tuple[str, List[str]]]) – The executable to run with input (question, previous_messages) and returns a tuple of (response, log).
**kwargs – The input arguments for the executable.
- thread_ts: str#
Module contents#
- class sherpa_ai.error_handling.AgentErrorHandler[source]#
Bases:
object
- error_map: Dict[BaseException, str]#
- run_with_error_handling(executable: Callable[[str], str], **kwargs)[source]#
Run the executable with error handling. If an error occurs, return the error message.
- Parameters:
executable (Callable[[str, List[Dict]], Tuple[str, List[str]]]) – The executable to run with input (question, previous_messages) and returns a tuple of (response, log).
**kwargs – The input arguments for the executable.
- thread_ts: str#