Current section
Files
Jump to
Current section
Files
lib/snakebridge/runtime_client.ex
defmodule SnakeBridge.RuntimeClient do
@moduledoc """
Behaviour for runtime clients that execute SnakeBridge payloads.
The default runtime client is `Snakepit`, but tests can override
this via the `:runtime_client` config or a per-process override.
"""
@type tool :: String.t()
@type payload :: map()
@type opts :: keyword()
@type callback :: (term() -> any())
@callback execute(tool(), payload(), opts()) ::
{:ok, term()} | {:error, Snakepit.Error.t()}
@callback execute_stream(tool(), payload(), callback(), opts()) ::
:ok | {:error, Snakepit.Error.t()}
end