Closed LeoAnt02 closed 3 months ago
const chain = RunnableSequence.from([ { context: retriever.pipe(formatDocumentsAsString), input: new RunnablePassthrough().pick("input"), }, generalPrompt, ollama, new StringOutputParser(), ]); const stream = await chain.stream({ input: lastUserMessage, chat_history: history });
Failed to process the request text.replace is not a function { "stack": "TypeError: text.replace is not a function\n at OpenAIEmbeddings.embedQuery
I want to select a specific input from my .invoke or .stream in the RunnableSequence
as if I did
const chain = RunnableSequence.from([ { context: retriever.pipe(formatDocumentsAsString), input: new RunnablePassthrough(), }, generalPrompt, ollama, new StringOutputParser(), ]); const stream = await chain.stream({ input: lastUserMessage, chat_history: history });
typescript, "langchain": "^0.1.37",
Seems like the solution is this
new RunnablePassthrough().pick(["input"])
takes an array of string instead of a direct string
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Failed to process the request text.replace is not a function { "stack": "TypeError: text.replace is not a function\n at OpenAIEmbeddings.embedQuery
Description
I want to select a specific input from my .invoke or .stream in the RunnableSequence
as if I did
System Info
typescript, "langchain": "^0.1.37",