mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-23 01:00:22 +03:00
df26e8aef9
* added perplexity node * last stable release * Update ChatPerplexity.ts * update * Update ChatPerplexity.ts * Update ChatPerplexity.ts * pnpm lint fix * feat: update @langchain/community from 0.3.24 to 0.3.29 --------- Co-authored-by: Marvin <marvin.chin@regentmarkets.com>
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { ChatPerplexity as LangchainChatPerplexity, type PerplexityChatInput } from '@langchain/community/chat_models/perplexity'
|
|
import { IMultiModalOption, IVisionChatModal } from '../../../src'
|
|
|
|
// Extend the Langchain ChatPerplexity class to include Flowise-specific properties and methods
|
|
export class ChatPerplexity extends LangchainChatPerplexity implements IVisionChatModal {
|
|
configuredModel: string
|
|
configuredMaxToken?: number
|
|
multiModalOption: IMultiModalOption
|
|
id: string
|
|
|
|
constructor(id: string, fields: PerplexityChatInput) {
|
|
super(fields)
|
|
this.id = id
|
|
this.configuredModel = fields?.model ?? '' // Use model from fields
|
|
this.configuredMaxToken = fields?.maxTokens
|
|
}
|
|
|
|
// Method to revert to the original model configuration
|
|
revertToOriginalModel(): void {
|
|
this.model = this.configuredModel
|
|
this.maxTokens = this.configuredMaxToken
|
|
}
|
|
|
|
// Method to set multimodal options
|
|
setMultiModalOption(multiModalOption: IMultiModalOption): void {
|
|
this.multiModalOption = multiModalOption
|
|
}
|
|
|
|
setVisionModel(): void {
|
|
// pass
|
|
}
|
|
}
|