mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 11:01:18 +03:00
Merge branch 'main' into feature/Indexing
# Conflicts: # pnpm-lock.yaml
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
|
||||
import { BedrockChat as LCBedrockChat } from '@langchain/community/chat_models/bedrock'
|
||||
import { BaseBedrockInput } from '@langchain/community/dist/utils/bedrock'
|
||||
import { IVisionChatModal, IMultiModalOption } from '../../../src'
|
||||
|
||||
export class BedrockChat extends LCBedrockChat implements IVisionChatModal {
|
||||
configuredModel: string
|
||||
configuredMaxToken: number
|
||||
multiModalOption: IMultiModalOption
|
||||
id: string
|
||||
|
||||
constructor(id: string, fields: BaseBedrockInput & BaseChatModelParams) {
|
||||
super(fields)
|
||||
this.id = id
|
||||
this.configuredModel = fields?.model || 'anthropic.claude-3-haiku-20240307-v1:0'
|
||||
this.configuredMaxToken = fields?.maxTokens ?? 256
|
||||
}
|
||||
|
||||
revertToOriginalModel(): void {
|
||||
super.model = this.configuredModel
|
||||
super.maxTokens = this.configuredMaxToken
|
||||
}
|
||||
|
||||
setMultiModalOption(multiModalOption: IMultiModalOption): void {
|
||||
this.multiModalOption = multiModalOption
|
||||
}
|
||||
|
||||
setVisionModel(): void {
|
||||
if (!this.model.startsWith('claude-3')) {
|
||||
super.model = 'anthropic.claude-3-haiku-20240307-v1:0'
|
||||
super.maxTokens = 1024
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user