forked from Archives/langchain
Harrison/spell executor (#4914)
Co-authored-by: Jan Minar <rdancer@rdancer.org>
This commit is contained in:
parent
c06973261a
commit
5feb60f426
@ -1,6 +1,7 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"id": "406483c4",
|
||||
"metadata": {},
|
||||
@ -15,6 +16,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"id": "91192118",
|
||||
"metadata": {},
|
||||
@ -38,6 +40,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"id": "0b10d200",
|
||||
"metadata": {},
|
||||
@ -70,6 +73,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"id": "ce38ae84",
|
||||
"metadata": {},
|
||||
@ -114,10 +118,11 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"agent = PlanAndExecute(planner=planner, executer=executor, verbose=True)"
|
||||
"agent = PlanAndExecute(planner=planner, executor=executor, verbose=True)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"attachments": {},
|
||||
"cell_type": "markdown",
|
||||
"id": "8be9f1bd",
|
||||
"metadata": {},
|
||||
|
@ -14,7 +14,7 @@ from langchain.experimental.plan_and_execute.schema import (
|
||||
|
||||
class PlanAndExecute(Chain):
|
||||
planner: BasePlanner
|
||||
executer: BaseExecutor
|
||||
executor: BaseExecutor
|
||||
step_container: BaseStepContainer = Field(default_factory=ListStepContainer)
|
||||
input_key: str = "input"
|
||||
output_key: str = "output"
|
||||
@ -41,7 +41,7 @@ class PlanAndExecute(Chain):
|
||||
for step in plan.steps:
|
||||
_new_inputs = {"previous_steps": self.step_container, "current_step": step}
|
||||
new_inputs = {**_new_inputs, **inputs}
|
||||
response = self.executer.step(
|
||||
response = self.executor.step(
|
||||
new_inputs,
|
||||
callbacks=run_manager.get_child() if run_manager else None,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user