factor_agent.llm.replay.ReplayBackend#

class ReplayBackend(log)[source]#

Bases: object

Answer each request with the recorded reply to the same role, model and prompt.

A request asked several times gets its recorded replies in order.

Raises:
ValueError

If the log holds no call (a wrong path, or a run that made none).

Methods#

ReplayBackend.complete

Return the recorded reply to request.

ReplayBackend.from_config

Build from {"log": <the llm_log directory of the recorded run>}.

Attributes#

ReplayBackend.OPTIONS = ('log',)#

The options a role’s config may give besides backend and model; log is needed.