From 4a4c940dbd9f709dd99119772cacf9fa9989716f Mon Sep 17 00:00:00 2001 From: Vijay Sai Date: Fri, 26 May 2023 16:07:50 +0530 Subject: [PATCH] fixed all the linting issues --- .../nodes/chains/ApiChain/ApiChain.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/components/nodes/chains/ApiChain/ApiChain.ts b/packages/components/nodes/chains/ApiChain/ApiChain.ts index 90d136610..6fb655605 100644 --- a/packages/components/nodes/chains/ApiChain/ApiChain.ts +++ b/packages/components/nodes/chains/ApiChain/ApiChain.ts @@ -32,7 +32,7 @@ class ApiChain_Chains implements INode { { label: 'Document', name: 'document', - type: 'Document', + type: 'Document' } ] } @@ -45,7 +45,7 @@ class ApiChain_Chains implements INode { return chain } - async run(nodeData: INodeData, input: string, options: ICommonObject): Promise { + async run(nodeData: INodeData, input: string, options: ICommonObject): Promise { const model = nodeData.inputs?.model as BaseLanguageModel const docs = nodeData.inputs?.document as Document[] @@ -61,16 +61,16 @@ class ApiChain_Chains implements INode { } } -const getOpenAPIChain = async (documents: Document[], llm: BaseLanguageModel, options: any = {}) => { - const texts = documents.map(({ pageContent }) => pageContent); +const getOpenAPIChain = async (documents: Document[], llm: BaseLanguageModel) => { + const texts = documents.map(({ pageContent }) => pageContent) const apiResponsePrompt = new PromptTemplate({ - inputVariables: ["api_docs", "question", "api_url", "api_response"], - template: "Given this {api_response} response for {api_url}. use the given response to answer this {question}", - }); + inputVariables: ['api_docs', 'question', 'api_url', 'api_response'], + template: 'Given this {api_response} response for {api_url}. use the given response to answer this {question}' + }) - const chain = APIChain.fromLLMAndAPIDocs(llm, texts.toString(), { - apiResponsePrompt, - verbose: process.env.DEBUG === 'true' ? true : false, + const chain = APIChain.fromLLMAndAPIDocs(llm, texts.toString(), { + apiResponsePrompt, + verbose: process.env.DEBUG === 'true' ? true : false }) return chain }