Current section
Files
Jump to
Current section
Files
lib/snakebridge_generated/dspy/datasets/gsm8k/__init__.ex
# Generated by SnakeBridge v0.13.0 - DO NOT EDIT MANUALLY
# Regenerate with: mix compile
# Library: dspy 3.1.2
# Python module: dspy.datasets.gsm8k
defmodule Dspy.Datasets.Gsm8k do
@moduledoc """
Submodule bindings for `dspy.datasets.gsm8k`.
## Version
- Requested: 3.1.2
- Observed at generation: 3.1.2
## Runtime Options
All functions accept a `__runtime__` option for controlling execution behavior:
Dspy.Datasets.Gsm8k.some_function(args, __runtime__: [timeout: 120_000])
### Supported runtime options
- `:timeout` - Call timeout in milliseconds (default: 120,000ms / 2 minutes)
- `:timeout_profile` - Use a named profile (`:default`, `:ml_inference`, `:batch_job`, `:streaming`)
- `:stream_timeout` - Timeout for streaming operations (default: 1,800,000ms / 30 minutes)
- `:session_id` - Override the session ID for this call
- `:pool_name` - Target a specific Snakepit pool (multi-pool setups)
- `:affinity` - Override session affinity (`:hint`, `:strict_queue`, `:strict_fail_fast`)
### Timeout Profiles
- `:default` - 2 minute timeout for regular calls
- `:ml_inference` - 10 minute timeout for ML/LLM workloads
- `:batch_job` - Unlimited timeout for long-running jobs
- `:streaming` - 2 minute timeout, 30 minute stream_timeout
### Example with timeout override
# For a long-running ML inference call
Dspy.Datasets.Gsm8k.predict(data, __runtime__: [timeout_profile: :ml_inference])
# Or explicit timeout
Dspy.Datasets.Gsm8k.predict(data, __runtime__: [timeout: 600_000])
# Route to a pool and enforce strict affinity
Dspy.Datasets.Gsm8k.predict(data, __runtime__: [pool_name: :strict_pool, affinity: :strict_queue])
See `SnakeBridge.Defaults` for global timeout configuration.
"""
@doc false
def __snakebridge_python_name__, do: "dspy.datasets.gsm8k"
@doc false
def __snakebridge_library__, do: "dspy"
@doc """
Python binding for `dspy.datasets.gsm8k.gsm8k_metric`.
## Parameters
- `gold` (term())
- `pred` (term())
- `trace` (term() default: None)
## Returns
- `term()`
"""
@spec gsm8k_metric(term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec gsm8k_metric(term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec gsm8k_metric(term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec gsm8k_metric(term(), term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def gsm8k_metric(gold, pred) do
SnakeBridge.Runtime.call(__MODULE__, :gsm8k_metric, [gold, pred], [])
end
def gsm8k_metric(gold, pred, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :gsm8k_metric, [gold, pred], opts)
end
def gsm8k_metric(gold, pred, trace) do
SnakeBridge.Runtime.call(__MODULE__, :gsm8k_metric, [gold, pred, trace], [])
end
def gsm8k_metric(gold, pred, trace, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :gsm8k_metric, [gold, pred, trace], opts)
end
@doc """
Python binding for `dspy.datasets.gsm8k.parse_integer_answer`.
## Parameters
- `answer` (term())
- `only_first_line` (term() default: True)
## Returns
- `term()`
"""
@spec parse_integer_answer(term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec parse_integer_answer(term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec parse_integer_answer(term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()}
@spec parse_integer_answer(term(), term(), keyword()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
def parse_integer_answer(answer) do
SnakeBridge.Runtime.call(__MODULE__, :parse_integer_answer, [answer], [])
end
def parse_integer_answer(answer, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :parse_integer_answer, [answer], opts)
end
def parse_integer_answer(answer, only_first_line) do
SnakeBridge.Runtime.call(__MODULE__, :parse_integer_answer, [answer, only_first_line], [])
end
def parse_integer_answer(answer, only_first_line, opts)
when is_list(opts) and
(opts == [] or
(is_tuple(hd(opts)) and tuple_size(hd(opts)) == 2 and is_atom(elem(hd(opts), 0)))) do
SnakeBridge.Runtime.call(__MODULE__, :parse_integer_answer, [answer, only_first_line], opts)
end
end