KScript docs
EN

fake_llm fields and methods

A field is a plain fact about the value, read with a dot and no brackets: $value.name. A method takes arguments or does work, and is called with ->: $value->name(arguments), or with the value piped in: $value |> name(arguments).

From KScript.AI

These need <import package="KScript.AI" />import KScript.AI. See KScript.AI.

#fake_llm->count() → number KScript.AI

How many times the script asked the model.
Example
<let name="fake" value="@fake_llm(['One', 'Two'])" />
<do>@llm('First?')</do>
<echo>{ $fake->count() }</echo>
$fake = @fake_llm(['One', 'Two'])
@llm('First?')
echo $fake->count()

#fake_llm->prompts() → list KScript.AI

The prompts the script sent, oldest first: the text of each question.
Example
<let name="fake" value="@fake_llm(fn(prompt) => $prompt->upper())" />
<do>@llm('hello')</do>
<echo>{ $fake->prompts() }</echo>
$fake = @fake_llm(fn(prompt) => $prompt->upper())
@llm('hello')
echo $fake->prompts()

Methods from any