Skip to content

Commit

Permalink
Syntax fix in ImageConversationChain.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vgees authored Oct 23, 2023
1 parent 3c0d784 commit 752fb13
Showing 1 changed file with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface';
import { RetrievalQAChain } from 'langchain/chains';
import { getBaseClasses } from '../../../src/utils';
import { ConsoleCallbackHandler, additionalCallbacks } from '../../../src/handler';
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
import { RetrievalQAChain } from 'langchain/chains'
import { getBaseClasses } from '../../../src/utils'
import { ConsoleCallbackHandler, additionalCallbacks } from '../../../src/handler'

class ImageConversationChain_Chains implements INode {
label: string;
name: string;
version: number;
type: string;
icon: string;
category: string;
baseClasses: string[];
description: string;
inputs: INodeParams[];
label: string
name: string
version: number
type: string
icon: string
category: string
baseClasses: string[]
description: string
inputs: INodeParams[]

constructor() {
this.label = 'Image Conversation Chain';
this.name = 'imageConversationChain';
this.version = 1.0;
this.type = 'ImageConversationChain';
this.icon = 'image.png';
this.category = 'Chains';
this.description = 'QA chain to answer a question based on the retrieved images';
this.baseClasses = [this.type, ...getBaseClasses(RetrievalQAChain)];
this.label = 'Image Conversation Chain'
this.name = 'imageConversationChain'
this.version = 1.0
this.type = 'ImageConversationChain'
this.icon = 'image.png'
this.category = 'Chains'
this.description = 'QA chain to answer a question based on the retrieved images'
this.baseClasses = [this.type, ...getBaseClasses(RetrievalQAChain)]
this.inputs = [
{
label: 'Image Description',
name: 'imageDescription',
type: 'description'
}
];
]
}

async init(nodeData: INodeData): Promise<any> {

Check warning on line 35 in packages/components/nodes/chains/ImageConversationChain/ImageConversationChain.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.15.0)

'nodeData' is defined but never used. Allowed unused args must match /^_/u
Expand All @@ -38,15 +38,15 @@ class ImageConversationChain_Chains implements INode {
}

async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string> {
const imageDescription = nodeData.inputs?.imageDescription as string;
const loggerHandler = new ConsoleCallbackHandler(options.logger);
const callbacks = await additionalCallbacks(nodeData, options);
const imageDescription = nodeData.inputs?.imageDescription as string
const loggerHandler = new ConsoleCallbackHandler(options.logger)

Check warning on line 42 in packages/components/nodes/chains/ImageConversationChain/ImageConversationChain.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.15.0)

'loggerHandler' is assigned a value but never used. Allowed unused vars must match /^_/u
const callbacks = await additionalCallbacks(nodeData, options)

Check warning on line 43 in packages/components/nodes/chains/ImageConversationChain/ImageConversationChain.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.15.0)

'callbacks' is assigned a value but never used. Allowed unused vars must match /^_/u

// TODO: Any logic or operations you want to do with the image description can go here
// For now, it simply returns the description

return imageDescription;
return imageDescription
}
}

module.exports = { nodeClass: ImageConversationChain_Chains };
module.exports = { nodeClass: ImageConversationChain_Chains }

0 comments on commit 752fb13

Please sign in to comment.