Current section

Files

Jump to
dspex lib snakebridge_generated dspy utils unbatchify unbatchify.ex
Raw

lib/snakebridge_generated/dspy/utils/unbatchify/unbatchify.ex

# Generated by SnakeBridge v0.12.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: dspy 3.1.2
# Python module: dspy.utils.unbatchify
# Python class: Unbatchify
defmodule Dspy.Utils.Unbatchify do
def __snakebridge_python_name__, do: "dspy.utils.unbatchify"
def __snakebridge_python_class__, do: "Unbatchify"
def __snakebridge_library__, do: "dspy"
@opaque t :: SnakeBridge.Ref.t()
@spec new(term(), list(term()), keyword()) ::
{:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
def new(batch_fn, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_class(__MODULE__, :__init__, [batch_fn] ++ List.wrap(args), opts)
end
@spec _worker(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def _worker(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :_worker, [], opts)
end
@spec close(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def close(ref, opts \\ []) do
SnakeBridge.Runtime.call_method(ref, :close, [], opts)
end
end