Skip to main content

LLMService

Stentor API Reference


Stentor API Reference / stentor-models/src / LLMService

Interface: LLMService

Defined in: packages/stentor-models/src/Services/LLMService.ts:86

A service that generates text from a prompt sent to an LLM.

The response is raw model output. Callers are responsible for parsing it, and for the fact that a model can return something that does not match the shape that was asked for -- validate what comes back against whatever list or schema the prompt constrained it to, rather than trusting it.

Methods​

generate()​

generate(prompt, options?): Promise<LLMServiceResponse>

Defined in: packages/stentor-models/src/Services/LLMService.ts:95

Generate a response for the given prompt.

Parameters​

prompt​

Prompt

The prompt to send.

options?​

Optional parameters, such as a timeout in milliseconds.

timeout?​

number

Returns​

Promise<LLMServiceResponse>

The model's response.

Throws​

If the underlying service is unavailable or the prompt is invalid.