Packages

Minimal Elixir AI SDK scaffolding for streaming text with tool calls.

Current section

Files

Jump to
ai_sdk_ex lib ai errors.ex
Raw

lib/ai/errors.ex

defmodule AI.Errors do
@moduledoc """
Error types used across the SDK.
"""
defmodule InvalidPromptError do
@moduledoc """
Raised when a prompt or messages input is invalid.
"""
defexception [:message, :prompt]
end
defmodule InvalidToolInputError do
@moduledoc """
Raised when a tool input does not match its JSON schema.
"""
defexception [:message, :tool_name, :input]
end
defmodule NoSuchToolError do
@moduledoc """
Raised when a tool name is not found in the tool map.
"""
defexception [:message, :tool_name]
end
defmodule ProviderError do
@moduledoc """
Raised for provider-specific errors.
"""
defexception [:message, :provider, :details]
end
end