Class: MistralAI
MistralAI LLM implementation
Hierarchy
BaseLLM
↳
MistralAI
Constructors
constructor
• new MistralAI(init?
)
Parameters
Name | Type |
---|---|
init? | Partial <MistralAI > |
Overrides
BaseLLM.constructor
Defined in
packages/core/src/llm/mistral.ts:64
Properties
apiKey
• Optional
apiKey: string
Defined in
packages/core/src/llm/mistral.ts:57
callbackManager
• Optional
callbackManager: CallbackManager
Defined in
packages/core/src/llm/mistral.ts:58
maxTokens
• Optional
maxTokens: number
Defined in
packages/core/src/llm/mistral.ts:56
model
• model: "mistral-tiny"
| "mistral-small"
| "mistral-medium"
Defined in
packages/core/src/llm/mistral.ts:53
randomSeed
• Optional
randomSeed: number
Defined in
packages/core/src/llm/mistral.ts:60
safeMode
• safeMode: boolean
Defined in
packages/core/src/llm/mistral.ts:59
session
• Private
session: MistralAISession
Defined in
packages/core/src/llm/mistral.ts:62
temperature
• temperature: number
Defined in
packages/core/src/llm/mistral.ts:54
topP
• topP: number
Defined in
packages/core/src/llm/mistral.ts:55
Accessors
metadata
• get
metadata(): Object
Returns
Object
Name | Type |
---|---|
contextWindow | number |
maxTokens | undefined | number |
model | "mistral-tiny" | "mistral-small" | "mistral-medium" |
temperature | number |
tokenizer | undefined |
topP | number |
Overrides
BaseLLM.metadata
Defined in
packages/core/src/llm/mistral.ts:76
Methods
buildParams
▸ Private
buildParams(messages
): any
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
any
Defined in
packages/core/src/llm/mistral.ts:91
chat
▸ chat(params
): Promise
<AsyncIterable
<ChatResponseChunk
>>
Parameters
Name | Type |
---|---|
params | LLMChatParamsStreaming |
Returns
Promise
<AsyncIterable
<ChatResponseChunk
>>
Overrides
BaseLLM.chat
Defined in
packages/core/src/llm/mistral.ts:103
▸ chat(params
): Promise
<ChatResponse
>
Parameters
Name | Type |
---|---|
params | LLMChatParamsNonStreaming |
Returns
Promise
<ChatResponse
>
Overrides
BaseLLM.chat
Defined in
packages/core/src/llm/mistral.ts:106
complete
▸ complete(params
): Promise
<AsyncIterable
<CompletionResponse
>>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsStreaming |
Returns
Promise
<AsyncIterable
<CompletionResponse
>>
Inherited from
BaseLLM.complete
Defined in
packages/core/src/llm/base.ts:18
▸ complete(params
): Promise
<CompletionResponse
>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsNonStreaming |
Returns
Promise
<CompletionResponse
>
Inherited from
BaseLLM.complete
Defined in
packages/core/src/llm/base.ts:21
streamChat
▸ Protected
streamChat(«destructured»
): AsyncIterable
<ChatResponseChunk
>
Parameters
Name | Type |
---|---|
«destructured» | LLMChatParamsStreaming |
Returns
AsyncIterable
<ChatResponseChunk
>
Defined in
packages/core/src/llm/mistral.ts:124
tokens
▸ tokens(messages
): number
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
number
Overrides
BaseLLM.tokens