Scripted Model • AI Agent SDK
ScriptedModel: A model double that returns scripted replies in order and records requests.
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]No description available.
Methods
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).
Append more replies to the script. Returns `self` for chaining.
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 GitHubpraisonaiagents/model_harness/scripted.py at line 272