Skip to main content

Class: Anthropic

Anthropic LLM implementation

Implements

Constructors

constructor

new Anthropic(init?)

Parameters

NameType
init?Partial<Anthropic>

Defined in

llm/LLM.ts:466

Properties

apiKey

Optional apiKey: string = undefined

Defined in

llm/LLM.ts:459


callbackManager

Optional callbackManager: CallbackManager

Defined in

llm/LLM.ts:464


maxRetries

maxRetries: number

Defined in

llm/LLM.ts:460


maxTokens

Optional maxTokens: number

Defined in

llm/LLM.ts:456


model

model: string

Defined in

llm/LLM.ts:453


session

session: AnthropicSession

Defined in

llm/LLM.ts:462


temperature

temperature: number

Defined in

llm/LLM.ts:454


timeout

Optional timeout: number

Defined in

llm/LLM.ts:461


topP

topP: number

Defined in

llm/LLM.ts:455

Methods

chat

chat(messages, parentEvent?): Promise<ChatResponse>

Get a chat response from the LLM

Parameters

NameType
messagesChatMessage[]
parentEvent?Event

Returns

Promise<ChatResponse>

Implementation of

LLM.chat

Defined in

llm/LLM.ts:501


complete

complete(prompt, parentEvent?): Promise<ChatResponse>

Get a prompt completion from the LLM

Parameters

NameTypeDescription
promptstringthe prompt to complete
parentEvent?Event-

Returns

Promise<ChatResponse>

Implementation of

LLM.complete

Defined in

llm/LLM.ts:519


mapMessagesToPrompt

mapMessagesToPrompt(messages): string

Parameters

NameType
messagesChatMessage[]

Returns

string

Defined in

llm/LLM.ts:486