# Generated by SnakeBridge v0.13.0 - DO NOT EDIT MANUALLY # Regenerate with: mix compile # Library: dspy 3.1.2 # Python module: dspy.evaluate # Python class: EvaluationResult defmodule Dspy.Evaluate.EvaluationResult do @moduledoc """ A class that represents the result of an evaluation. It is a subclass of `dspy.Prediction` that contains the following fields - score: An float value (e.g., 67.30) representing the overall performance - results: a list of (example, prediction, score) tuples for each example in devset """ def __snakebridge_python_name__, do: "dspy.evaluate" def __snakebridge_python_class__, do: "EvaluationResult" def __snakebridge_library__, do: "dspy" @opaque t :: SnakeBridge.Ref.t() @doc """ Initialize an Example instance. ## Parameters - `base` - Optional base data source. Can be: - Another Example instance (copies its data) - A dictionary (copies its key-value pairs) - None (creates empty Example) **kwargs: Additional key-value pairs to store in the Example. """ @spec new( float(), list({Dspy.Primitives.Example.t(), Dspy.Primitives.Example.t(), term()}), keyword() ) :: {:ok, SnakeBridge.Ref.t()} | {:error, Snakepit.Error.t()} def new(score, results, opts \\ []) do SnakeBridge.Runtime.call_class(__MODULE__, :__init__, [score, results], opts) end @doc """ Python method `EvaluationResult.copy`. ## Parameters - `kwargs` (term()) ## Returns - `term()` """ @spec copy(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def copy(ref, opts \\ []) do SnakeBridge.Runtime.call_method(ref, :copy, [], opts) end @doc """ Python method `EvaluationResult.from_completions`. ## Parameters - `list_or_dict` (term()) - `signature` (term() default: None) ## Returns - `term()` """ @spec from_completions(SnakeBridge.Ref.t(), term(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def from_completions(ref, list_or_dict, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method( ref, :from_completions, [list_or_dict] ++ List.wrap(args), opts ) end @doc """ Python method `EvaluationResult.get`. ## Parameters - `key` (term()) - `default` (term() default: None) ## Returns - `term()` """ @spec get(SnakeBridge.Ref.t(), term(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def get(ref, key, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method(ref, :get, [key] ++ List.wrap(args), opts) end @doc """ Python method `EvaluationResult.get_lm_usage`. ## Returns - `term()` """ @spec get_lm_usage(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def get_lm_usage(ref, opts \\ []) do SnakeBridge.Runtime.call_method(ref, :get_lm_usage, [], opts) end @doc """ Python method `EvaluationResult.inputs`. ## Returns - `term()` """ @spec inputs(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def inputs(ref, opts \\ []) do SnakeBridge.Runtime.call_method(ref, :inputs, [], opts) end @doc """ Python method `EvaluationResult.items`. ## Parameters - `include_dspy` (term() default: False) ## Returns - `term()` """ @spec items(SnakeBridge.Ref.t(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def items(ref, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method(ref, :items, [] ++ List.wrap(args), opts) end @doc """ Python method `EvaluationResult.keys`. ## Parameters - `include_dspy` (term() default: False) ## Returns - `term()` """ @spec keys(SnakeBridge.Ref.t(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def keys(ref, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method(ref, :keys, [] ++ List.wrap(args), opts) end @doc """ Python method `EvaluationResult.labels`. ## Returns - `term()` """ @spec labels(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def labels(ref, opts \\ []) do SnakeBridge.Runtime.call_method(ref, :labels, [], opts) end @doc """ Python method `EvaluationResult.set_lm_usage`. ## Parameters - `value` (term()) ## Returns - `term()` """ @spec set_lm_usage(SnakeBridge.Ref.t(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def set_lm_usage(ref, value, opts \\ []) do SnakeBridge.Runtime.call_method(ref, :set_lm_usage, [value], opts) end @doc """ Python method `EvaluationResult.toDict`. ## Returns - `term()` """ @spec to_dict(SnakeBridge.Ref.t(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def to_dict(ref, opts \\ []) do SnakeBridge.Runtime.call_method(ref, "toDict", [], opts) end @doc """ Python method `EvaluationResult.values`. ## Parameters - `include_dspy` (term() default: False) ## Returns - `term()` """ @spec values(SnakeBridge.Ref.t(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def values(ref, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method(ref, :values, [] ++ List.wrap(args), opts) end @doc """ Python method `EvaluationResult.with_inputs`. ## Parameters - `keys` (term()) ## Returns - `term()` """ @spec with_inputs(SnakeBridge.Ref.t(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def with_inputs(ref, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method(ref, :with_inputs, [] ++ List.wrap(args), opts) end @doc """ Python method `EvaluationResult.without`. ## Parameters - `keys` (term()) ## Returns - `term()` """ @spec without(SnakeBridge.Ref.t(), list(term()), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def without(ref, args, opts \\ []) do {args, opts} = SnakeBridge.Runtime.normalize_args_opts(args, opts) SnakeBridge.Runtime.call_method(ref, :without, [] ++ List.wrap(args), opts) end @spec completions(SnakeBridge.Ref.t()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def completions(ref) do SnakeBridge.Runtime.get_attr(ref, :completions) end end