So im trying to create something like a search engine using searxng and langchain. Now the problem in the below piece of code is that it gives an error -
Type 'RunnableLambda<ImageSearchChainInput, { chat_history: string; query: string; }>' is not assignable to type 'RunnableLike<ImageSearchChainInput, any>'. Type 'RunnableLambda<ImageSearchChainInput, { chat_history: string; query: string; }>' is not assignable to type 'RunnableMapLike<ImageSearchChainInput, any>'. Index signature for type 'string' is missing in type 'RunnableLambda<ImageSearchChainInput, { chat_history: string; query: string; }>'.ts(2322)
I tried checking out a tutorial and they have done the exact same thing but it does not work me for some reason. I would appreciate any help
type ImageSearchChainInput = {
chat_history: BaseMessage[];
query: string;
};
const imageSearchChain = RunnableSequence.from([
//first we are extracting the chat history and the query from the input ImageSearchChainInput
RunnableLambda.from(async (input: ImageSearchChainInput) => ({
chat_history: formatChatHistoryAsString(input.chat_history),
query: input.query,
})),
....