Logo
Classes

BaseLLM

Defined in: packages/core/src/llms/base.ts:36

Unified language model interface

Extended by

Type Parameters

AdditionalChatOptions

AdditionalChatOptions extends object = object

AdditionalMessageOptions

AdditionalMessageOptions extends object = object

Implements

  • LLM<AdditionalChatOptions>

Constructors

Constructor

new BaseLLM<AdditionalChatOptions, AdditionalMessageOptions>(): BaseLLM<AdditionalChatOptions, AdditionalMessageOptions>

Returns

BaseLLM<AdditionalChatOptions, AdditionalMessageOptions>

Properties

metadata

abstract metadata: LLMMetadata

Defined in: packages/core/src/llms/base.ts:41

Implementation of

LLM.metadata

Methods

complete()

Call Signature

complete(params): Promise<AsyncIterable<CompletionResponse, any, any>>

Defined in: packages/core/src/llms/base.ts:43

Get a prompt completion from the LLM

Parameters
params

LLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse, any, any>>

Implementation of

LLM.complete

Call Signature

complete(params): Promise<CompletionResponse>

Defined in: packages/core/src/llms/base.ts:46

Parameters
params

LLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Implementation of

LLM.complete


chat()

Call Signature

abstract chat(params): Promise<AsyncIterable<ChatResponseChunk<AdditionalMessageOptions>, any, any>>

Defined in: packages/core/src/llms/base.ts:78

Get a chat response from the LLM

Parameters
params

LLMChatParamsStreaming<AdditionalChatOptions, AdditionalMessageOptions>

Returns

Promise<AsyncIterable<ChatResponseChunk<AdditionalMessageOptions>, any, any>>

Implementation of

LLM.chat

Call Signature

abstract chat(params): Promise<ChatResponse<AdditionalMessageOptions>>

Defined in: packages/core/src/llms/base.ts:84

Parameters
params

LLMChatParamsNonStreaming<AdditionalChatOptions, AdditionalMessageOptions>

Returns

Promise<ChatResponse<AdditionalMessageOptions>>

Implementation of

LLM.chat


exec()

Call Signature

exec<Z>(params): Promise<ExecStreamResponse<AdditionalMessageOptions, ZodInfer<Z>>>

Defined in: packages/core/src/llms/base.ts:91

Type Parameters
Z

Z extends ZodSchema

Parameters
params

LLMChatParamsStreaming<AdditionalChatOptions, AdditionalMessageOptions, Z>

Returns

Promise<ExecStreamResponse<AdditionalMessageOptions, ZodInfer<Z>>>

Call Signature

exec<Z>(params): Promise<ExecResponse<AdditionalMessageOptions, ZodInfer<Z>>>

Defined in: packages/core/src/llms/base.ts:98

Type Parameters
Z

Z extends ZodSchema

Parameters
params

LLMChatParamsNonStreaming<AdditionalChatOptions, AdditionalMessageOptions, Z>

Returns

Promise<ExecResponse<AdditionalMessageOptions, ZodInfer<Z>>>


streamExec()

streamExec<Z>(params): Promise<ExecStreamResponse<AdditionalMessageOptions, ZodInfer<Z>>>

Defined in: packages/core/src/llms/base.ts:181

Type Parameters

Z

Z extends ZodSchema

Parameters

params

LLMChatParamsStreaming<AdditionalChatOptions, AdditionalMessageOptions, Z>

Returns

Promise<ExecStreamResponse<AdditionalMessageOptions, ZodInfer<Z>>>