fixed all the linting issues

This commit is contained in:
Vijay Sai 2023-05-26 16:07:50 +05:30
parent 06f933132b
commit 4a4c940dbd
1 changed files with 10 additions and 10 deletions

View File

@ -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<string> {
async run(nodeData: INodeData, input: string, options: ICommonObject): Promise<string> {
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
}