Current section
Files
Jump to
Current section
Files
lib/snakebridge_generated/dspy/provider.ex
# Generated by SnakeBridge v0.16.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: dspy 3.1.3
# Python module: dspy
# Python class: Provider
defmodule Dspy.Provider do
@moduledoc """
Wrapper for Python class Provider.
"""
def __snakebridge_python_name__, do: "dspy"
def __snakebridge_python_class__, do: "Provider"
def __snakebridge_library__, do: "dspy"
@opaque t :: SnakeBridge.Ref.t()
@doc """
Initialize self. See help(type(self)) for accurate signature.
"""
@spec new(keyword()) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
def new(opts \\ []) do
SnakeBridge.Runtime.call_class(__MODULE__, :__init__, [], opts)
end
@doc """
Python method `Provider.finetune`.
## Parameters
- `job` (term())
- `model` (String.t())
- `train_data` (list(%{optional(String.t()) => term()}))
- `train_data_format` (term())
- `train_kwargs` (term() default: None)
## Returns
- `String.t()`
"""
@spec finetune(
SnakeBridge.Ref.t(),
term(),
String.t(),
list(%{optional(String.t()) => term()}),
term(),
list(term()),
keyword()
) :: {:ok, String.t()} | {:error, Snakepit.Error.t()}
def finetune(ref, job, model, train_data, train_data_format, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(
ref,
:finetune,
[job, model, train_data, train_data_format] ++ List.wrap(args),
opts
)
end
@doc """
Python method `Provider.is_provider_model`.
## Parameters
- `model` (String.t())
## Returns
- `boolean()`
"""
@spec is_provider_model(SnakeBridge.Ref.t(), String.t(), keyword()) ::
{:ok, boolean()} | {:error, Snakepit.Error.t()}
def is_provider_model(ref, model, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :is_provider_model, [model], opts)
end
@doc """
Python method `Provider.kill`.
## Parameters
- `lm` (term())
- `launch_kwargs` (term() default: None)
## Returns
- `term()`
"""
@spec kill(SnakeBridge.Ref.t(), term(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def kill(ref, lm, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :kill, [lm] ++ List.wrap(args), opts)
end
@doc """
Python method `Provider.launch`.
## Parameters
- `lm` (term())
- `launch_kwargs` (term() default: None)
## Returns
- `term()`
"""
@spec launch(SnakeBridge.Ref.t(), term(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def launch(ref, lm, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, :launch, [lm] ++ List.wrap(args), opts)
end
end