Skip to main content

ScriptedModel

Defined in the scripted module.
AI Agent A model double that returns scripted replies in order and records requests. Pass one to an agent in place of a model name:: model = ScriptedModel([“done”]) agent = Agent(instructions=”…”, llm=model)

Constructor

Iterable[ScriptEntry]
default:"()"
No description available.

Methods

tool_call()

Script a turn in which the model calls one tool.

tool_calls()

Script a turn in which the model calls several tools at once.

text()

Script a plain assistant answer (the same as a bare str entry).

extend()

Append more replies to the script. Returns self for chaining.

reset()

Rewind to the start of the script and forget recorded requests.

requests()

Every request the agent has sent to this double, in order.

request_count()

How many requests the agent has sent.

remaining()

How many scripted replies are still unused.

exhausted()

Whether every scripted reply has been consumed.

Source

View on GitHub

praisonaiagents/model_harness/scripted.py at line 272