Mv plan and execute to experimental (#4459)

This commit is contained in:
Davis Chase 2023-05-10 08:31:53 -07:00 committed by GitHub
parent 1ad180f6de
commit 04475bea7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 39 additions and 32 deletions

View File

@ -30,8 +30,8 @@
"outputs": [],
"source": [
"from langchain.chat_models import ChatOpenAI\n",
"from langchain.experimental.plan_and_execute import PlanAndExecute, load_agent_executor, load_chat_planner\n",
"from langchain.llms import OpenAI\n",
"from langchain.agents import PlanAndExecute, load_agent_executor, load_chat_planner\n",
"from langchain import SerpAPIWrapper\n",
"from langchain.agents.tools import Tool\n",
"from langchain import LLMMathChain"
@ -54,7 +54,6 @@
"source": [
"search = SerpAPIWrapper()\n",
"llm = OpenAI(temperature=0)\n",
"search = SerpAPIWrapper()\n",
"llm_math_chain = LLMMathChain.from_llm(llm=llm, verbose=True)\n",
"tools = [\n",
" Tool(\n",
@ -355,7 +354,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.11.3"
}
},
"nbformat": 4,

View File

@ -26,11 +26,6 @@ from langchain.agents.initialize import initialize_agent
from langchain.agents.load_tools import get_all_tool_names, load_tools
from langchain.agents.loading import load_agent
from langchain.agents.mrkl.base import MRKLChain, ZeroShotAgent
from langchain.agents.plan_and_execute.agent_executor import PlanAndExecute
from langchain.agents.plan_and_execute.executors.agent_executor import (
load_agent_executor,
)
from langchain.agents.plan_and_execute.planners.chat_planner import load_chat_planner
from langchain.agents.react.base import ReActChain, ReActTextWorldAgent
from langchain.agents.self_ask_with_search.base import SelfAskWithSearchChain
from langchain.agents.structured_chat.base import StructuredChatAgent
@ -68,7 +63,4 @@ __all__ = [
"load_agent",
"load_tools",
"tool",
"PlanAndExecute",
"load_chat_planner",
"load_agent_executor",
]

View File

@ -1,7 +0,0 @@
from langchain.agents.plan_and_execute.agent_executor import PlanAndExecute
from langchain.agents.plan_and_execute.executors.agent_executor import (
load_agent_executor,
)
from langchain.agents.plan_and_execute.planners.chat_planner import load_chat_planner
__all__ = ["PlanAndExecute", "load_agent_executor", "load_chat_planner"]

View File

@ -2,5 +2,18 @@ from langchain.experimental.autonomous_agents.autogpt.agent import AutoGPT
from langchain.experimental.autonomous_agents.baby_agi.baby_agi import BabyAGI
from langchain.experimental.generative_agents.generative_agent import GenerativeAgent
from langchain.experimental.generative_agents.memory import GenerativeAgentMemory
from langchain.experimental.plan_and_execute import (
PlanAndExecute,
load_agent_executor,
load_chat_planner,
)
__all__ = ["BabyAGI", "AutoGPT", "GenerativeAgent", "GenerativeAgentMemory"]
__all__ = [
"BabyAGI",
"AutoGPT",
"GenerativeAgent",
"GenerativeAgentMemory",
"PlanAndExecute",
"load_agent_executor",
"load_chat_planner",
]

View File

@ -0,0 +1,9 @@
from langchain.experimental.plan_and_execute.agent_executor import PlanAndExecute
from langchain.experimental.plan_and_execute.executors.agent_executor import (
load_agent_executor,
)
from langchain.experimental.plan_and_execute.planners.chat_planner import (
load_chat_planner,
)
__all__ = ["PlanAndExecute", "load_agent_executor", "load_chat_planner"]

View File

@ -2,14 +2,14 @@ from typing import Any, Dict, List, Optional
from pydantic import Field
from langchain.agents.plan_and_execute.executors.base import BaseExecutor
from langchain.agents.plan_and_execute.planners.base import BasePlanner
from langchain.agents.plan_and_execute.schema import (
from langchain.callbacks.manager import CallbackManagerForChainRun
from langchain.chains.base import Chain
from langchain.experimental.plan_and_execute.executors.base import BaseExecutor
from langchain.experimental.plan_and_execute.planners.base import BasePlanner
from langchain.experimental.plan_and_execute.schema import (
BaseStepContainer,
ListStepContainer,
)
from langchain.callbacks.manager import CallbackManagerForChainRun
from langchain.chains.base import Chain
class PlanAndExecute(Chain):

View File

@ -1,9 +1,9 @@
from typing import List
from langchain.agents.agent import AgentExecutor
from langchain.agents.plan_and_execute.executors.base import ChainExecutor
from langchain.agents.structured_chat.base import StructuredChatAgent
from langchain.base_language import BaseLanguageModel
from langchain.experimental.plan_and_execute.executors.base import ChainExecutor
from langchain.tools import BaseTool
HUMAN_MESSAGE_TEMPLATE = """Previous steps: {previous_steps}

View File

@ -3,9 +3,9 @@ from typing import Any
from pydantic import BaseModel
from langchain.agents.plan_and_execute.schema import StepResponse
from langchain.callbacks.manager import Callbacks
from langchain.chains.base import Chain
from langchain.experimental.plan_and_execute.schema import StepResponse
class BaseExecutor(BaseModel):

View File

@ -3,9 +3,9 @@ from typing import Any, List, Optional
from pydantic import BaseModel
from langchain.agents.plan_and_execute.schema import Plan, PlanOutputParser
from langchain.callbacks.manager import Callbacks
from langchain.chains.llm import LLMChain
from langchain.experimental.plan_and_execute.schema import Plan, PlanOutputParser
class BasePlanner(BaseModel):

View File

@ -1,9 +1,13 @@
import re
from langchain.agents.plan_and_execute.planners.base import LLMPlanner
from langchain.agents.plan_and_execute.schema import Plan, PlanOutputParser, Step
from langchain.base_language import BaseLanguageModel
from langchain.chains import LLMChain
from langchain.experimental.plan_and_execute.planners.base import LLMPlanner
from langchain.experimental.plan_and_execute.schema import (
Plan,
PlanOutputParser,
Step,
)
from langchain.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
from langchain.schema import SystemMessage

View File

@ -32,9 +32,6 @@ _EXPECTED = [
"load_agent",
"load_tools",
"tool",
"PlanAndExecute",
"load_chat_planner",
"load_agent_executor",
]