mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
@@ -125,7 +125,7 @@ class ChatAnthropic_ChatModels implements INode {
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const maxTokensToSample = nodeData.inputs?.maxTokensToSample as string
|
||||
const maxTokens = nodeData.inputs?.maxTokensToSample as string
|
||||
const topP = nodeData.inputs?.topP as string
|
||||
const topK = nodeData.inputs?.topK as string
|
||||
const streaming = nodeData.inputs?.streaming as boolean
|
||||
@@ -143,7 +143,7 @@ class ChatAnthropic_ChatModels implements INode {
|
||||
streaming: streaming ?? true
|
||||
}
|
||||
|
||||
if (maxTokensToSample) obj.maxTokensToSample = parseInt(maxTokensToSample, 10)
|
||||
if (maxTokens) obj.maxTokens = parseInt(maxTokens, 10)
|
||||
if (topP) obj.topP = parseFloat(topP)
|
||||
if (topK) obj.topK = parseFloat(topK)
|
||||
if (cache) obj.cache = cache
|
||||
|
||||
@@ -11,8 +11,8 @@ export class ChatAnthropic extends LangchainChatAnthropic implements IVisionChat
|
||||
constructor(id: string, fields: Partial<AnthropicInput> & BaseLLMParams & { anthropicApiKey?: string }) {
|
||||
super(fields)
|
||||
this.id = id
|
||||
this.configuredModel = fields?.modelName || 'claude-3-haiku-20240307'
|
||||
this.configuredMaxToken = fields?.maxTokens ?? 256
|
||||
this.configuredModel = fields?.modelName || ''
|
||||
this.configuredMaxToken = fields?.maxTokens ?? 2048
|
||||
}
|
||||
|
||||
revertToOriginalModel(): void {
|
||||
@@ -27,7 +27,7 @@ export class ChatAnthropic extends LangchainChatAnthropic implements IVisionChat
|
||||
setVisionModel(): void {
|
||||
if (!this.modelName.startsWith('claude-3')) {
|
||||
super.modelName = 'claude-3-haiku-20240307'
|
||||
super.maxTokens = 1024
|
||||
super.maxTokens = this.configuredMaxToken ? this.configuredMaxToken : 2048
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user