2025-01-27 20:19:11 +08:00
|
|
|
class WorkflowError(Exception):
|
|
|
|
|
"""
|
|
|
|
|
Exception indicating an error that the current loop cannot handle, preventing further progress.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
2026-04-17 22:52:07 +02:00
|
|
|
class LLMUnavailableError(RuntimeError):
|
|
|
|
|
"""
|
|
|
|
|
Raised when the LLM backend fails to respond after all retries.
|
|
|
|
|
Registered as skip_loop_error in QuantRDLoop so a transient LLM outage
|
|
|
|
|
skips the current loop iteration instead of killing the whole process.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
2025-01-27 20:19:11 +08:00
|
|
|
class FormatError(WorkflowError):
|
|
|
|
|
"""
|
|
|
|
|
After multiple attempts, we are unable to obtain the answer in the correct format to proceed.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
2026-03-02 19:04:10 +08:00
|
|
|
class CodeBlockParseError(FormatError):
|
|
|
|
|
"""Raised when code block extraction fails after all strategies."""
|
|
|
|
|
|
|
|
|
|
def __init__(self, message: str, content: str, language: str) -> None:
|
|
|
|
|
self.message = message
|
|
|
|
|
self.content = content
|
|
|
|
|
self.language = language
|
|
|
|
|
super().__init__(message)
|
|
|
|
|
|
|
|
|
|
|
2025-01-27 20:19:11 +08:00
|
|
|
class CoderError(WorkflowError):
|
2024-05-21 22:48:41 +08:00
|
|
|
"""
|
|
|
|
|
Exceptions raised when Implementing and running code.
|
2024-07-05 17:42:00 +08:00
|
|
|
- start: FactorTask => FactorGenerator
|
2024-05-21 22:48:41 +08:00
|
|
|
- end: Get dataframe after execution
|
|
|
|
|
|
|
|
|
|
The more detailed evaluation in dataframe values are managed by the evaluator.
|
|
|
|
|
"""
|
|
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
# NOTE: it corresponds to the error of **component**
|
2025-08-04 17:44:51 +08:00
|
|
|
caused_by_timeout: bool = False # whether the error is caused by timeout
|
2025-01-17 22:53:05 +08:00
|
|
|
|
2024-05-21 22:48:41 +08:00
|
|
|
|
2024-07-18 22:36:04 +08:00
|
|
|
class CodeFormatError(CoderError):
|
2024-05-21 22:48:41 +08:00
|
|
|
"""
|
|
|
|
|
The generated code is not found due format error.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
2024-07-18 22:36:04 +08:00
|
|
|
class CustomRuntimeError(CoderError):
|
2024-05-21 22:48:41 +08:00
|
|
|
"""
|
|
|
|
|
The generated code fail to execute the script.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
2024-07-18 22:36:04 +08:00
|
|
|
class NoOutputError(CoderError):
|
2024-05-21 22:48:41 +08:00
|
|
|
"""
|
|
|
|
|
The code fail to generate output file.
|
|
|
|
|
"""
|
2024-07-17 15:00:13 +08:00
|
|
|
|
|
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
class RunnerError(Exception):
|
2024-07-17 15:00:13 +08:00
|
|
|
"""
|
|
|
|
|
Exceptions raised when running the code output.
|
|
|
|
|
"""
|
|
|
|
|
|
2025-01-17 22:53:05 +08:00
|
|
|
# NOTE: it corresponds to the error of whole **project**
|
|
|
|
|
|
2024-07-17 15:00:13 +08:00
|
|
|
|
2025-02-25 12:06:07 +08:00
|
|
|
FactorEmptyError = CoderError # Exceptions raised when no factor is generated correctly
|
2024-07-17 15:00:13 +08:00
|
|
|
|
2025-02-25 12:06:07 +08:00
|
|
|
ModelEmptyError = CoderError # Exceptions raised when no model is generated correctly
|
2024-11-04 14:57:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class KaggleError(Exception):
|
|
|
|
|
"""
|
|
|
|
|
Exceptions raised when calling Kaggle API
|
|
|
|
|
"""
|
2025-05-29 17:23:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class PolicyError(Exception):
|
|
|
|
|
"""
|
|
|
|
|
Exceptions raised due to content management policy
|
|
|
|
|
"""
|
2026-03-02 19:04:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class EvaluatorDidNotTerminateError(RuntimeError):
|
|
|
|
|
"""
|
|
|
|
|
Evaluator generator did not terminate with a final Feedback.
|
|
|
|
|
"""
|