Skip to content

Commit

Permalink
Add runnable lambda from method (langchain-ai#2827)
Browse files Browse the repository at this point in the history
* Expose iterable readable stream, add runnable lambda from method

* Remove stream export
  • Loading branch information
jacoblee93 authored Oct 7, 2023
1 parent b899748 commit c89ed3c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions langchain/src/schema/runnable/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,14 @@ export class RunnableLambda<RunInput, RunOutput> extends Runnable<
this.func = fields.func;
}

static from<RunInput, RunOutput>(
func: RunnableFunc<RunInput, RunOutput>
): RunnableLambda<RunInput, RunOutput> {
return new RunnableLambda({
func,
});
}

async _invoke(
input: RunInput,
config?: Partial<BaseCallbackConfig>,
Expand Down

0 comments on commit c89ed3c

Please sign in to comment.