Current section

Files

Jump to
dspex lib snakebridge_generated dspy example.ex
Raw

lib/snakebridge_generated/dspy/example.ex

# Generated by SnakeBridge v0.12.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: dspy 3.1.2
# Python module: dspy
# Python class: Example
defmodule Dspy.Example do
def __snakebridge_python_name__, do: "dspy"
def __snakebridge_python_class__, do: "Example"
def __snakebridge_library__, do: "dspy"
@opaque t :: SnakeBridge.Ref.t()
@spec new(list(term()), keyword()) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
def new(args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_class(__MODULE__, :__init__, [] ++ List.wrap(args), opts)
end
@spec copy(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def copy(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :copy, [], opts)
end
@spec get(SnakeBridge.Ref.t(), term(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def get(ref, key, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :get, [key] ++ List.wrap(args), opts)
end
@spec inputs(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def inputs(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :inputs, [], opts)
end
@spec items(SnakeBridge.Ref.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def items(ref, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :items, [] ++ List.wrap(args), opts)
end
@spec keys(SnakeBridge.Ref.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def keys(ref, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :keys, [] ++ List.wrap(args), opts)
end
@spec labels(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def labels(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :labels, [], opts)
end
@spec to_dict(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def to_dict(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, "toDict", [], opts)
end
@spec values(SnakeBridge.Ref.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def values(ref, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :values, [] ++ List.wrap(args), opts)
end
@spec with_inputs(SnakeBridge.Ref.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def with_inputs(ref, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :with_inputs, [] ++ List.wrap(args), opts)
end
@spec without(SnakeBridge.Ref.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def without(ref, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :without, [] ++ List.wrap(args), opts)
end
end