mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
feature/add-perplexity-node (#4376)
* 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>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user