# Generated by SnakeBridge v0.12.0 - DO NOT EDIT MANUALLY # Regenerate with: mix compile # Library: dspy 3.1.2 # Python module: dspy.clients defmodule Dspy.Clients do @moduledoc """ Submodule bindings for `dspy.clients`. """ def __snakebridge_python_name__, do: "dspy.clients" def __snakebridge_library__, do: "dspy" @doc """ Configure the cache for DSPy. ## Parameters - `enable_disk_cache` - Whether to enable on-disk cache. - `enable_memory_cache` - Whether to enable in-memory cache. - `disk_cache_dir` - The directory to store the on-disk cache. - `disk_size_limit_bytes` - The size limit of the on-disk cache. - `memory_max_entries` - The maximum number of entries in the in-memory cache. To allow the cache to grow without bounds, set this parameter to `math.inf` or a similar value. Parameters: - `enable_disk_cache` (term() default: True) - `enable_memory_cache` (term() default: True) - `disk_cache_dir` (term() default: '/home/home/.dspy_cache') - `disk_size_limit_bytes` (term() default: 30000000000) - `memory_max_entries` (integer() default: 1000000) Returns: - `term()` """ @spec configure_cache() :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), term(), term()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), term(), term(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), term(), term(), integer()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec configure_cache(term(), term(), term(), term(), integer(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def configure_cache() do SnakeBridge.Runtime.call(__MODULE__, :configure_cache, [], []) end def configure_cache(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__, :configure_cache, [], opts) end def configure_cache(enable_disk_cache) do SnakeBridge.Runtime.call(__MODULE__, :configure_cache, [enable_disk_cache], []) end def configure_cache(enable_disk_cache, 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__, :configure_cache, [enable_disk_cache], opts) end def configure_cache(enable_disk_cache, enable_memory_cache) do SnakeBridge.Runtime.call( __MODULE__, :configure_cache, [enable_disk_cache, enable_memory_cache], [] ) end def configure_cache(enable_disk_cache, enable_memory_cache, 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__, :configure_cache, [enable_disk_cache, enable_memory_cache], opts ) end def configure_cache(enable_disk_cache, enable_memory_cache, disk_cache_dir) do SnakeBridge.Runtime.call( __MODULE__, :configure_cache, [enable_disk_cache, enable_memory_cache, disk_cache_dir], [] ) end def configure_cache(enable_disk_cache, enable_memory_cache, disk_cache_dir, 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__, :configure_cache, [enable_disk_cache, enable_memory_cache, disk_cache_dir], opts ) end def configure_cache( enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes ) do SnakeBridge.Runtime.call( __MODULE__, :configure_cache, [enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes], [] ) end def configure_cache( enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes, 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__, :configure_cache, [enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes], opts ) end def configure_cache( enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes, memory_max_entries ) do SnakeBridge.Runtime.call( __MODULE__, :configure_cache, [ enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes, memory_max_entries ], [] ) end def configure_cache( enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes, memory_max_entries, 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__, :configure_cache, [ enable_disk_cache, enable_memory_cache, disk_cache_dir, disk_size_limit_bytes, memory_max_entries ], opts ) end @doc """ """ @spec disable_litellm_logging(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def disable_litellm_logging(opts \\ []) do SnakeBridge.Runtime.call(__MODULE__, :disable_litellm_logging, [], opts) end @doc """ """ @spec enable_litellm_logging(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def enable_litellm_logging(opts \\ []) do SnakeBridge.Runtime.call(__MODULE__, :enable_litellm_logging, [], opts) end @doc """ The global history shared across all LMs. Parameters: - `n` (integer() default: 1) Returns: - `term()` """ @spec inspect_history() :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec inspect_history(keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec inspect_history(integer()) :: {:ok, term()} | {:error, Snakepit.Error.t()} @spec inspect_history(integer(), keyword()) :: {:ok, term()} | {:error, Snakepit.Error.t()} def inspect_history() do SnakeBridge.Runtime.call(__MODULE__, :inspect_history, [], []) end def inspect_history(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__, :inspect_history, [], opts) end def inspect_history(n) do SnakeBridge.Runtime.call(__MODULE__, :inspect_history, [n], []) end def inspect_history(n, 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__, :inspect_history, [n], opts) end end