Class: Anthropic
Anthropic LLM implementation
Implements
Constructors
constructor
• new Anthropic(init?
)
Parameters
Name | Type |
---|---|
init? | Partial <Anthropic > |
Defined in
Properties
apiKey
• Optional
apiKey: string
= undefined
Defined in
callbackManager
• Optional
callbackManager: CallbackManager
Defined in
maxRetries
• maxRetries: number
Defined in
maxTokens
• Optional
maxTokens: number
Defined in
model
• model: string
Defined in
session
• session: AnthropicSession
Defined in
temperature
• temperature: number
Defined in
timeout
• Optional
timeout: number
Defined in
topP
• topP: number
Defined in
Methods
chat
▸ chat(messages
, parentEvent?
): Promise
<ChatResponse
>
Get a chat response from the LLM
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
parentEvent? | Event |
Returns
Promise
<ChatResponse
>
Implementation of
Defined in
complete
▸ complete(prompt
, parentEvent?
): Promise
<ChatResponse
>
Get a prompt completion from the LLM
Parameters
Name | Type | Description |
---|---|---|
prompt | string | the prompt to complete |
parentEvent? | Event | - |
Returns
Promise
<ChatResponse
>
Implementation of
Defined in
mapMessagesToPrompt
▸ mapMessagesToPrompt(messages
): string
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
string