Current section

Files

Jump to
dspex lib snakebridge_generated dspy teleprompt bootstrap_trace failed_prediction.ex
Raw

lib/snakebridge_generated/dspy/teleprompt/bootstrap_trace/failed_prediction.ex

# Generated by SnakeBridge v0.14.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: dspy 3.1.2
# Python module: dspy.teleprompt.bootstrap_trace
# Python class: FailedPrediction
defmodule Dspy.Teleprompt.BootstrapTrace.FailedPrediction do
@moduledoc """
FailedPrediction(completion_text: str, format_reward: float | None = None)
"""
def __snakebridge_python_name__, do: "dspy.teleprompt.bootstrap_trace"
def __snakebridge_python_class__, do: "FailedPrediction"
def __snakebridge_library__, do: "dspy"
@opaque t :: SnakeBridge.Ref.t()
@doc """
Initialize self. See help(type(self)) for accurate signature.
## Parameters
- `completion_text` (String.t())
- `format_reward` (term() default: None)
"""
@spec new(String.t(), list(term()), keyword()) ::
{:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()}
def new(completion_text, args, opts \\ []) do
{args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts)
SnakeBridge.Runtime.call_class(
__MODULE__,
:__init__,
[completion_text] ++ List.wrap(args),
opts
)
end
@spec format_reward(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
def format_reward(ref) do
SnakeBridge.Runtime.get_attr(ref, :format_reward)
end
end