Replies: 1 comment 1 reply
-
Hi @zirkelc, you can achieve the same result by using the const sqlQueryGeneratorChain = RunnableSequence.from([
new RunnablePassthrough().pipe(async (input) => ({
...input, ...db.getTableInfo(), // Input object gets merged with the new object
})),
prompt,
new ChatOpenAI({}).bind({ stop: ["\nSQLResult:"] }),
new StringOutputParser(),
]); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently,
RunnablePassthrough.assign()
needs an object / RunnableMap as input:IMHO, it would be useful to make
RunnablePassthrough.assign()
accept a function / RunnableLambda as input:The result from
RunnablePassthrough.assign()
from the function would get merged with the input, the same way it is currently implemented forRunnableMap
.Beta Was this translation helpful? Give feedback.
All reactions