Current section

Files

Jump to
dspex lib snakebridge_generated dspy bootstrap_finetune.ex
Raw

lib/snakebridge_generated/dspy/bootstrap_finetune.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: BootstrapFinetune
defmodule Dspy.BootstrapFinetune do
def __snakebridge_python_name__, do: "dspy"
def __snakebridge_python_class__, do: "BootstrapFinetune"
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 _prepare_finetune_data(
SnakeBridge.Ref.t(),
list(%{optional(String.t()) => term()}),
Dspy.Clients.LMClass.t(),
list(term()),
keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def _prepare_finetune_data(ref, trace_data, lm, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(
ref,
:_prepare_finetune_data,
[trace_data, lm] ++ List.wrap(args),
opts
)
end
@spec compile(
SnakeBridge.Ref.t(),
Dspy.Primitives.Module.Module.t(),
list(Dspy.Primitives.Example.t()),
list(term()),
keyword()
) :: {:ok, Dspy.Primitives.Module.Module.t()} | {:error, Snakepit.Error.t()}
def compile(ref, student, trainset, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :compile, [student, trainset] ++ List.wrap(args), opts)
end
@spec convert_to_lm_dict(SnakeBridge.Ref.t(), term(), keyword()) ::
{:ok, %{optional(Dspy.Clients.LMClass.t()) => term()}} | {:error, Snakepit.Error.t()}
def convert_to_lm_dict(ref, arg, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :convert_to_lm_dict, [arg], opts)
end
@spec finetune_lms(SnakeBridge.Ref.t(), term(), keyword()) ::
{:ok, %{optional(term()) => Dspy.Clients.LMClass.t()}} | {:error, Snakepit.Error.t()}
def finetune_lms(ref, finetune_dict, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :finetune_lms, [finetune_dict], opts)
end
@spec get_params(SnakeBridge.Ref.t(), keyword()) ::
{:ok, %{optional(String.t()) => term()}} | {:error, Snakepit.Error.t()}
def get_params(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :get_params, [], opts)
end
end