> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Scripted Model • AI Agent SDK

> ScriptedModel: A model double that returns scripted replies in order and records requests.

# ScriptedModel

> Defined in the [**scripted**](../modules/scripted) module.

<Badge color="blue">AI Agent</Badge>

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

<ParamField query="script" type="Iterable[ScriptEntry]" required={false} default="()">
  No description available.
</ParamField>

## Methods

<CardGroup cols={2}>
  <Card title="tool_call()" icon="function" href="../functions/ScriptedModel-tool_call">
    Script a turn in which the model calls one tool.
  </Card>

  <Card title="tool_calls()" icon="function" href="../functions/ScriptedModel-tool_calls">
    Script a turn in which the model calls several tools at once.
  </Card>

  <Card title="text()" icon="function" href="../functions/ScriptedModel-text">
    Script a plain assistant answer (the same as a bare `str` entry).
  </Card>

  <Card title="extend()" icon="function" href="../functions/ScriptedModel-extend">
    Append more replies to the script. Returns `self` for chaining.
  </Card>

  <Card title="reset()" icon="function" href="../functions/ScriptedModel-reset">
    Rewind to the start of the script and forget recorded requests.
  </Card>

  <Card title="requests()" icon="function" href="../functions/ScriptedModel-requests">
    Every request the agent has sent to this double, in order.
  </Card>

  <Card title="request_count()" icon="function" href="../functions/ScriptedModel-request_count">
    How many requests the agent has sent.
  </Card>

  <Card title="remaining()" icon="function" href="../functions/ScriptedModel-remaining">
    How many scripted replies are still unused.
  </Card>

  <Card title="exhausted()" icon="function" href="../functions/ScriptedModel-exhausted">
    Whether every scripted reply has been consumed.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/model_harness/scripted.py#L272">
  `praisonaiagents/model_harness/scripted.py` at line 272
</Card>
