最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

typescript - Index signature for type 'string' is missing in type 'RunnableLambda<ImageSearchChai

programmeradmin4浏览0评论

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,
  })),
....
发布评论

评论列表(0)

  1. 暂无评论