exception langgraph_agent_toolkit.helper.exceptions.AgentToolkitError(message, error_code=None, details=None)[source][source]

Bases: Exception

Base exception for all LangGraph Agent Toolkit errors.

All custom exceptions should inherit from this base class.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source][source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.AgentError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for agent-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.AgentConfigurationError(message, error_code=None, details=None)[source][source]

Bases: AgentError

Raised when there’s an error in agent configuration.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.AgentExecutionError(message, error_code=None, details=None)[source][source]

Bases: AgentError

Raised when an agent fails to execute properly.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.AgentTimeoutError(message, error_code=None, details=None)[source][source]

Bases: AgentError

Raised when an agent operation times out.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.MessageError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for message-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.UnsupportedMessageTypeError(message_type, supported_types=None)[source][source]

Bases: MessageError

Raised when encountering an unsupported message type.

This replaces the string-based check for “Unsupported message type”.

Initialize with specific message type information.

Parameters:
  • message_type (str) – The unsupported message type

  • supported_types (list) – List of supported message types

__init__(message_type, supported_types=None)[source][source]

Initialize with specific message type information.

Parameters:
  • message_type (str) – The unsupported message type

  • supported_types (list) – List of supported message types

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.MessageConversionError(message, error_code=None, details=None)[source][source]

Bases: MessageError

Raised when message conversion fails.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ValidationError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for validation errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.InputValidationError(message, error_code=None, details=None)[source][source]

Bases: ValidationError

Raised when input validation fails.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ConfigurationValidationError(message, error_code=None, details=None)[source][source]

Bases: ValidationError

Raised when configuration validation fails.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ModelError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for model-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ModelNotFoundError(model_name, provider=None)[source][source]

Bases: ModelError

Raised when a requested model is not found.

Initialize with model information.

Parameters:
  • model_name (str) – Name of the model that wasn’t found

  • provider (str) – Optional model provider

__init__(model_name, provider=None)[source][source]

Initialize with model information.

Parameters:
  • model_name (str) – Name of the model that wasn’t found

  • provider (str) – Optional model provider

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ModelConfigurationError(message, error_code=None, details=None)[source][source]

Bases: ModelError

Raised when there’s an error in model configuration.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ToolError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for tool-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ToolNotFoundError(tool_name, available_tools=None)[source][source]

Bases: ToolError

Raised when a requested tool is not found.

Initialize with tool information.

Parameters:
  • tool_name (str) – Name of the tool that wasn’t found

  • available_tools (list) – List of available tools

__init__(tool_name, available_tools=None)[source][source]

Initialize with tool information.

Parameters:
  • tool_name (str) – Name of the tool that wasn’t found

  • available_tools (list) – List of available tools

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ToolExecutionError(tool_name, original_error=None)[source][source]

Bases: ToolError

Raised when tool execution fails.

Initialize with tool execution information.

Parameters:
  • tool_name (str) – Name of the tool that failed

  • original_error (Exception) – The original exception that caused the failure

__init__(tool_name, original_error=None)[source][source]

Initialize with tool execution information.

Parameters:
  • tool_name (str) – Name of the tool that failed

  • original_error (Exception) – The original exception that caused the failure

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.MemoryError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for memory-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.MemoryNotFoundError(identifier, identifier_type='thread')[source][source]

Bases: MemoryError

Raised when requested memory/thread is not found.

Initialize with memory identifier information.

Parameters:
  • identifier (str) – The identifier that wasn’t found

  • identifier_type (str) – Type of identifier (thread, user, etc.)

__init__(identifier, identifier_type='thread')[source][source]

Initialize with memory identifier information.

Parameters:
  • identifier (str) – The identifier that wasn’t found

  • identifier_type (str) – Type of identifier (thread, user, etc.)

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.MemoryOperationError(message, error_code=None, details=None)[source][source]

Bases: MemoryError

Raised when memory operations fail.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ObservabilityError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for observability-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.FeedbackError(run_id, operation, reason=None)[source][source]

Bases: ObservabilityError

Raised when feedback operations fail.

Initialize with feedback operation information.

Parameters:
  • run_id (str) – The run ID associated with the feedback

  • operation (str) – The feedback operation that failed

  • reason (str) – Optional reason for the failure

__init__(run_id, operation, reason=None)[source][source]

Initialize with feedback operation information.

Parameters:
  • run_id (str) – The run ID associated with the feedback

  • operation (str) – The feedback operation that failed

  • reason (str) – Optional reason for the failure

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.AuthenticationError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Raised when authentication fails.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.AuthorizationError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Raised when authorization fails.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.RateLimitError(resource, limit, reset_time=None)[source][source]

Bases: AgentToolkitError

Raised when rate limits are exceeded.

Initialize with rate limit information.

Parameters:
  • resource (str) – The resource that hit the rate limit

  • limit (int) – The rate limit that was exceeded

  • reset_time (float) – Optional time when the limit resets

__init__(resource, limit, reset_time=None)[source][source]

Initialize with rate limit information.

Parameters:
  • resource (str) – The resource that hit the rate limit

  • limit (int) – The rate limit that was exceeded

  • reset_time (float) – Optional time when the limit resets

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.NetworkError(message, error_code=None, details=None)[source][source]

Bases: AgentToolkitError

Base exception for network-related errors.

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

__init__(message, error_code=None, details=None)[source]

Initialize the base exception.

Parameters:
  • message (str) – Human-readable error message

  • error_code (str) – Optional error code for programmatic handling

  • details (dict) – Optional dictionary with additional error context

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception langgraph_agent_toolkit.helper.exceptions.ServiceUnavailableError(service, details=None)[source][source]

Bases: NetworkError

Raised when an external service is unavailable.

Initialize with service information.

Parameters:
  • service (str) – Name of the unavailable service

  • details (str) – Optional details about the unavailability

__init__(service, details=None)[source][source]

Initialize with service information.

Parameters:
  • service (str) – Name of the unavailable service

  • details (str) – Optional details about the unavailability

add_note()

Exception.add_note(note) – add a note to the exception

args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.