> ## 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**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/scripted.md) 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

**script** `Iterable[ScriptEntry]` (default: ())

No description available.

## Methods

> [card] [tool\_call()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-tool_call.md)
>
> Script a turn in which the model calls one tool.

> [card] [tool\_calls()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-tool_calls.md)
>
> Script a turn in which the model calls several tools at once.

> [card] [text()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-text.md)
>
> Script a plain assistant answer (the same as a bare `str` entry).

> [card] [extend()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-extend.md)
>
> Append more replies to the script. Returns `self` for chaining.

> [card] [reset()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-reset.md)
>
> Rewind to the start of the script and forget recorded requests.

> [card] [requests()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-requests.md)
>
> Every request the agent has sent to this double, in order.

> [card] [request\_count()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-request_count.md)
>
> How many requests the agent has sent.

> [card] [remaining()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-remaining.md)
>
> How many scripted replies are still unused.

> [card] [exhausted()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/ScriptedModel-exhausted.md)
>
> Whether every scripted reply has been consumed.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/model_harness/scripted.py#L272)
>
> `praisonaiagents/model_harness/scripted.py` at line 272


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.