Cyclium.Test.FakeSynthesizer (Cyclium v0.1.12)

Copy Markdown View Source

In-memory fake synthesizer for strategy testing. Records calls and returns configured responses.

Usage

setup do
  {:ok, _} = Cyclium.Test.FakeSynthesizer.start_link()
  Cyclium.Test.FakeSynthesizer.set_response(%{"answer" => "42"})
  :ok
end

Summary

Functions

Return all recorded synthesize calls as [{prompt_ctx, episode_ctx}].

Returns a specification to start this module under a supervisor.

Reset calls and response to defaults.

Set an error response.

Set the response returned by synthesize/2.

Set the token estimate returned by estimate_tokens/1.

Functions

calls()

Return all recorded synthesize calls as [{prompt_ctx, episode_ctx}].

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

reset()

Reset calls and response to defaults.

set_error(error_class, detail \\ %{})

Set an error response.

set_response(response)

Set the response returned by synthesize/2.

set_token_estimate(n)

Set the token estimate returned by estimate_tokens/1.

start_link(opts \\ [])