Replies: 1 comment
-
🤖 Hello! To make your agent "RunnableLike", you can use the Here is an example of how you can use it: const runnableAgent = new RunnableAgent(); // Assuming RunnableAgent is your agent that extends Runnable
const anotherRunnable = new AnotherRunnable(); // Assuming AnotherRunnable is another Runnable
const runnableLike = runnableAgent.pipe(anotherRunnable); In this example, This is supported by the following code from the context: pipe<NewRunOutput>(
coerceable: RunnableLike<RunOutput, NewRunOutput>
): RunnableSequence<RunInput, Exclude<NewRunOutput, Error>> {
if (RunnableSequence.isRunnableSequence(coerceable)) {
return new RunnableSequence({
first: this.first,
middle: this.middle.concat([
this.last,
coerceable.first,
...coerceable.middle,
]),
last: coerceable.last,
});
} else {
return new RunnableSequence({
first: this.first,
middle: [...this.middle, this.last],
last: _coerceToRunnable(coerceable),
});
}
} This code shows that the You can find more details about this in the langchain/src/schema/runnable/base.ts file. I hope this helps! Let me know if you have any other questions. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there! It's not clear to me how you include an agent in a Runnable chain
Someting like this: Is there a way of making the agent "RunnableLike"?
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions