-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
feat: Add image upload support to ChatOpenRouter node #5471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||
| import { ChatOpenAI as LangchainChatOpenAI, ChatOpenAIFields } from '@langchain/openai' | ||||||
| import { IMultiModalOption, IVisionChatModal } from '../../../src' | ||||||
|
|
||||||
| export class ChatOpenRouter extends LangchainChatOpenAI implements IVisionChatModal { | ||||||
| configuredModel: string | ||||||
| configuredMaxToken?: number | ||||||
| multiModalOption: IMultiModalOption | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||
| id: string | ||||||
|
|
||||||
| constructor(id: string, fields?: ChatOpenAIFields) { | ||||||
| super(fields) | ||||||
| this.id = id | ||||||
| this.configuredModel = fields?.modelName ?? '' | ||||||
| this.configuredMaxToken = fields?.maxTokens | ||||||
| } | ||||||
|
|
||||||
| revertToOriginalModel(): void { | ||||||
| this.model = this.configuredModel | ||||||
| this.maxTokens = this.configuredMaxToken | ||||||
| } | ||||||
|
|
||||||
| setMultiModalOption(multiModalOption: IMultiModalOption): void { | ||||||
| this.multiModalOption = multiModalOption | ||||||
| } | ||||||
|
|
||||||
| setVisionModel(): void { | ||||||
| // pass - OpenRouter models don't need model switching | ||||||
| } | ||||||
| } | ||||||
Uh oh!
There was an error while loading. Please reload this page.