mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
"""Exceptions for CopilotKit."""
|
|
|
|
class ActionNotFoundException(Exception):
|
|
"""Exception raised when an action or agent is not found."""
|
|
|
|
def __init__(self, name: str):
|
|
self.name = name
|
|
super().__init__(f"Action '{name}' not found.")
|
|
|
|
class AgentNotFoundException(Exception):
|
|
"""Exception raised when an agent is not found."""
|
|
|
|
def __init__(self, name: str):
|
|
self.name = name
|
|
super().__init__(f"Agent '{name}' not found.")
|
|
|
|
class ActionExecutionException(Exception):
|
|
"""Exception raised when an action fails to execute."""
|
|
|
|
def __init__(self, name: str, error: Exception):
|
|
self.name = name
|
|
self.error = error
|
|
super().__init__(f"Action '{name}' failed to execute: {error}")
|
|
|
|
class AgentExecutionException(Exception):
|
|
"""Exception raised when an agent fails to execute."""
|
|
|
|
def __init__(self, name: str, error: Exception):
|
|
self.name = name
|
|
self.error = error
|
|
super().__init__(f"Agent '{name}' failed to execute: {error}")
|