Current section
Files
Jump to
Current section
Files
lib/snakebridge_generated/dspy/clients/databricks/databricks_provider.ex
# Generated by SnakeBridge v0.12.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: dspy 3.1.2
# Python module: dspy.clients.databricks
# Python class: DatabricksProvider
defmodule Dspy.Clients.Databricks.DatabricksProvider do
def __snakebridge_python_name__, do: "dspy.clients.databricks"
def __snakebridge_python_class__, do: "DatabricksProvider"
def __snakebridge_library__, do: "dspy"
@opaque t :: SnakeBridge.Ref.t()
@spec new(keyword()) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
def new(opts \\ []) do
SnakeBridge.Runtime.call_class(__MODULE__, :__init__, [], opts)
end
@spec deploy_finetuned_model(SnakeBridge.Ref.t(), String.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def deploy_finetuned_model(ref, model, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(
ref,
:deploy_finetuned_model,
[model] ++ List.wrap(args),
opts
)
end
@spec finetune(
SnakeBridge.Ref.t(),
Dspy.Clients.Databricks.TrainingJobDatabricks.t(),
String.t(),
list(%{optional(String.t()) => term()}),
list(term()),
keyword()
) :: {:ok, String.t()} | {:error, Snakepit.Error.t()}
def finetune(ref, job, model, train_data, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(
ref,
:finetune,
[job, model, train_data] ++ List.wrap(args),
opts
)
end
@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
@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
@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
@spec training_job(SnakeBridge.Ref.t(), list(term()), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def training_job(ref, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_method(ref, "TrainingJob", [] ++ List.wrap(args), opts)
end
@spec upload_data(
SnakeBridge.Ref.t(),
list(%{optional(String.t()) => term()}),
String.t(),
Dspy.Clients.UtilsFinetune.TrainDataFormat.t(),
keyword()
) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def upload_data(ref, train_data, databricks_unity_catalog_path, data_format, opts \\ []) do
SnakeBridge.Runtime.call_method(
ref,
:upload_data,
[train_data, databricks_unity_catalog_path, data_format],
opts
)
end
@spec finetunable(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def finetunable(ref) do
SnakeBridge.Runtime.get_attr(ref, :finetunable)
end
end