Skip to content

Commit 752fb13

Browse files
authored
Syntax fix in ImageConversationChain.ts
1 parent 3c0d784 commit 752fb13

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface';
2-
import { RetrievalQAChain } from 'langchain/chains';
3-
import { getBaseClasses } from '../../../src/utils';
4-
import { ConsoleCallbackHandler, additionalCallbacks } from '../../../src/handler';
1+
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
2+
import { RetrievalQAChain } from 'langchain/chains'
3+
import { getBaseClasses } from '../../../src/utils'
4+
import { ConsoleCallbackHandler, additionalCallbacks } from '../../../src/handler'
55

66
class ImageConversationChain_Chains implements INode {
7-
label: string;
8-
name: string;
9-
version: number;
10-
type: string;
11-
icon: string;
12-
category: string;
13-
baseClasses: string[];
14-
description: string;
15-
inputs: INodeParams[];
7+
label: string
8+
name: string
9+
version: number
10+
type: string
11+
icon: string
12+
category: string
13+
baseClasses: string[]
14+
description: string
15+
inputs: INodeParams[]
1616

1717
constructor() {
18-
this.label = 'Image Conversation Chain';
19-
this.name = 'imageConversationChain';
20-
this.version = 1.0;
21-
this.type = 'ImageConversationChain';
22-
this.icon = 'image.png';
23-
this.category = 'Chains';
24-
this.description = 'QA chain to answer a question based on the retrieved images';
25-
this.baseClasses = [this.type, ...getBaseClasses(RetrievalQAChain)];
18+
this.label = 'Image Conversation Chain'
19+
this.name = 'imageConversationChain'
20+
this.version = 1.0
21+
this.type = 'ImageConversationChain'
22+
this.icon = 'image.png'
23+
this.category = 'Chains'
24+
this.description = 'QA chain to answer a question based on the retrieved images'
25+
this.baseClasses = [this.type, ...getBaseClasses(RetrievalQAChain)]
2626
this.inputs = [
2727
{
2828
label: 'Image Description',
2929
name: 'imageDescription',
3030
type: 'description'
3131
}
32-
];
32+
]
3333
}
3434

3535
async init(nodeData: INodeData): Promise<any> {
@@ -38,15 +38,15 @@ class ImageConversationChain_Chains implements INode {
3838
}
3939

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

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

48-
return imageDescription;
48+
return imageDescription
4949
}
5050
}
5151

52-
module.exports = { nodeClass: ImageConversationChain_Chains };
52+
module.exports = { nodeClass: ImageConversationChain_Chains }

0 commit comments

Comments
 (0)