factor_agent.llm.scripted.ScriptedBackend#

class ScriptedBackend(replies)[source]#

Bases: object

Answer each request with the next reply of a fixed list.

requests keeps every request received, in order; calls from several threads take the replies one at a time, in the order they arrive.

Raises:
RuntimeError

From complete when every reply has been used.

Methods#

ScriptedBackend.complete

Return the next scripted reply and keep request.

ScriptedBackend.from_config

Build from {"replies": <path to a JSON list of reply texts>}.

Attributes#

ScriptedBackend.OPTIONS = ('replies',)#

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