class LLM extends AbstractObject implements IdAble

Properties

$lastQuery from  AbstractObject

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

LLM
attempt(int $number)

create a branch in the LLM's history

bindResult(string $name)

returns the type of the current state

Env
env()

return the LLM's current environment

array
history()

return the llm message history

string
historyJSON()

return the raw llm message history as json

id()

A unique identifier for this LLM.

string
lastReply()

return the last llm reply from the history

LLM
loop()

synchronize LLM state

string
model()

return the model used by the llm

string
provider()

return the provider used by the llm

sync()

synchronize LLM state

tokenUsage()

returns the token usage of the current state

string
tools()

print documentation for available tools

LLM
withEnv(Env $env)

allow the LLM to interact with an environment via MCP

LLM
withModel(string $model)

swap out the llm model

LLM
withPrompt(string $prompt)

append a prompt to the llm context

LLM
withPromptFile(File $file)

append the contents of a file to the llm context

LLM
withQuery()

Provide the entire Query object to the LLM

LLM
withSystemPrompt(string $prompt)

Add a system prompt to the LLM's environment

Details

in AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

Parameters

AbstractClient $client
QueryBuilderChain $queryBuilderChain

in AbstractObject at line 19
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

Parameters

QueryBuilder $leafQueryBuilder
string $leafKey

Return Value

null|array|string|int|float|bool

at line 16
LLM attempt(int $number)

create a branch in the LLM's history

Parameters

int $number

Return Value

LLM

at line 26
Binding bindResult(string $name)

returns the type of the current state

Parameters

string $name

Return Value

Binding

at line 36
Env env()

return the LLM's current environment

Return Value

Env

at line 45
array history()

return the llm message history

Return Value

array

at line 54
string historyJSON()

return the raw llm message history as json

Return Value

string

at line 63
AbstractId id()

A unique identifier for this LLM.

Return Value

AbstractId

at line 72
string lastReply()

return the last llm reply from the history

Return Value

string

at line 81
LLM loop()

synchronize LLM state

Return Value

LLM

at line 90
string model()

return the model used by the llm

Return Value

string

at line 99
string provider()

return the provider used by the llm

Return Value

string

at line 108
LLMId sync()

synchronize LLM state

Return Value

LLMId

at line 117
LLMTokenUsage tokenUsage()

returns the token usage of the current state

Return Value

LLMTokenUsage

at line 126
string tools()

print documentation for available tools

Return Value

string

at line 135
LLM withEnv(Env $env)

allow the LLM to interact with an environment via MCP

Parameters

Env $env

Return Value

LLM

at line 145
LLM withModel(string $model)

swap out the llm model

Parameters

string $model

Return Value

LLM

at line 155
LLM withPrompt(string $prompt)

append a prompt to the llm context

Parameters

string $prompt

Return Value

LLM

at line 165
LLM withPromptFile(File $file)

append the contents of a file to the llm context

Parameters

File $file

Return Value

LLM

at line 175
LLM withQuery()

Provide the entire Query object to the LLM

Return Value

LLM

at line 184
LLM withSystemPrompt(string $prompt)

Add a system prompt to the LLM's environment

Parameters

string $prompt

Return Value

LLM