# Generated by SnakeBridge v0.12.0 - DO NOT EDIT MANUALLY # Regenerate with: mix compile # Library: dspy 3.1.2 # Python module: dspy.utils.magicattr defmodule Dspy.Utils.Magicattr do @moduledoc """ Submodule bindings for `dspy.utils.magicattr`. """ def __snakebridge_python_name__, do: "dspy.utils.magicattr" def __snakebridge_library__, do: "dspy" @doc """ A delattr that supports deletion of a nested lookups on objects, dicts, lists, and any combination in between. Parameters: - `obj` (term()) - `attr` (term()) Returns: - `term()` """ @spec delete(term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def delete(obj, attr, opts \\ []) do SnakeBridge.Runtime.call(__MODULE__, :delete, [obj, attr], opts) end @doc """ A getattr that supports nested lookups on objects, dicts, lists, and any combination in between. Parameters: - `obj` (term()) - `attr` (term()) - `kwargs` (term()) Returns: - `term()` """ @spec get(term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def get(obj, attr, opts \\ []) do SnakeBridge.Runtime.call(__MODULE__, :get, [obj, attr], opts) end @doc """ Like get but instead of returning the final value it returns the object and action that will be done. Parameters: - `obj` (term()) - `attr` (term()) Returns: - `term()` """ @spec lookup(term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def lookup(obj, attr, opts \\ []) do SnakeBridge.Runtime.call(__MODULE__, :lookup, [obj, attr], opts) end @doc """ A setattr that supports nested lookups on objects, dicts, lists, and any combination in between. Parameters: - `obj` (term()) - `attr` (term()) - `val` (term()) Returns: - `term()` """ @spec set(term(), term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def set(obj, attr, val, opts \\ []) do SnakeBridge.Runtime.call(__MODULE__, :set, [obj, attr, val], opts) end end