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

python - how to modify a step or a prompt of an existing langchain chain (customize SelfQueryRetriever)? - Stack Overflow

programmeradmin8浏览0评论

I need to customize a SelfQueryRetriever(the reason is: the generated target queries in OpenSearch are being generated incorrrectly so we need to tune prompts + we need to add some custom behavior such as multi-tenancy) but we don't want to re-write the whole chain, just the parts what we need to customize. How can we customize specific steps of a chain, is there a way to modify it by position, let's say something like this (pseudo-code):

retriever = SelfQueryRetriever(**config)
retriever[2] = create_custom_module1()
retriever[4] = create_custom_module2()

In this example we preserve the majority of the chain but customize only the third and fifth elements.

Is it possible to do?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论