본문으로 건너뛰기

Class: Anthropic

Anthropic LLM implementation

Hierarchy

  • BaseLLM

    Anthropic

Constructors

constructor

new Anthropic(init?)

Parameters

NameType
init?Partial<Anthropic>

Overrides

BaseLLM.constructor

Defined in

packages/core/src/llm/LLM.ts:589

Properties

apiKey

Optional apiKey: string = undefined

Defined in

packages/core/src/llm/LLM.ts:582


callbackManager

Optional callbackManager: CallbackManager

Defined in

packages/core/src/llm/LLM.ts:587


maxRetries

maxRetries: number

Defined in

packages/core/src/llm/LLM.ts:583


maxTokens

Optional maxTokens: number

Defined in

packages/core/src/llm/LLM.ts:579


model

model: "claude-2" | "claude-instant-1"

Defined in

packages/core/src/llm/LLM.ts:576


session

session: AnthropicSession

Defined in

packages/core/src/llm/LLM.ts:585


temperature

temperature: number

Defined in

packages/core/src/llm/LLM.ts:577


timeout

Optional timeout: number

Defined in

packages/core/src/llm/LLM.ts:584


topP

topP: number

Defined in

packages/core/src/llm/LLM.ts:578

Accessors

metadata

get metadata(): Object

Returns

Object

NameType
contextWindownumber
maxTokensundefined | number
model"claude-2" | "claude-instant-1"
temperaturenumber
tokenizerundefined
topPnumber

Overrides

BaseLLM.metadata

Defined in

packages/core/src/llm/LLM.ts:614

Methods

chat

chat(params): Promise<AsyncIterable<ChatResponseChunk>>

Parameters

NameType
paramsLLMChatParamsStreaming

Returns

Promise<AsyncIterable<ChatResponseChunk>>

Overrides

BaseLLM.chat

Defined in

packages/core/src/llm/LLM.ts:642

chat(params): Promise<ChatResponse>

Parameters

NameType
paramsLLMChatParamsNonStreaming

Returns

Promise<ChatResponse>

Overrides

BaseLLM.chat

Defined in

packages/core/src/llm/LLM.ts:645


complete

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

Parameters

NameType
paramsLLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse>>

Inherited from

BaseLLM.complete

Defined in

packages/core/src/llm/base.ts:18

complete(params): Promise<CompletionResponse>

Parameters

NameType
paramsLLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Inherited from

BaseLLM.complete

Defined in

packages/core/src/llm/base.ts:21


mapMessagesToPrompt

mapMessagesToPrompt(messages): string

Parameters

NameType
messagesChatMessage[]

Returns

string

Defined in

packages/core/src/llm/LLM.ts:625


streamChat

Protected streamChat(messages, parentEvent?): AsyncIterable<ChatResponseChunk>

Parameters

NameType
messagesChatMessage[]
parentEvent?Event

Returns

AsyncIterable<ChatResponseChunk>

Defined in

packages/core/src/llm/LLM.ts:671


tokens

tokens(messages): number

Parameters

NameType
messagesChatMessage[]

Returns

number

Overrides

BaseLLM.tokens

Defined in

packages/core/src/llm/LLM.ts:610