MCPcopy Create free account
hub / github.com/SqueezeAILab/LLMCompiler / initialize_react_agent_executor

Function initialize_react_agent_executor

src/react/base.py:44–64  ·  view source on GitHub ↗

Load an agent executor given tools and LLM. Simplified version of langchain.agents.initialize.initialize_agent

(
    llm: BaseLanguageModel,
    tools: Sequence[BaseTool],
    prompt: BasePromptTemplate,
    verbose: bool = False,
    agent_kwargs: dict[str, Any] = {},
)

Source from the content-addressed store, hash-verified

42
43
44def initialize_react_agent_executor(
45 llm: BaseLanguageModel,
46 tools: Sequence[BaseTool],
47 prompt: BasePromptTemplate,
48 verbose: bool = False,
49 agent_kwargs: dict[str, Any] = {},
50):
51 """Load an agent executor given tools and LLM.
52 Simplified version of langchain.agents.initialize.initialize_agent
53 """
54 agent = ReActDocstoreAgentForWiki.from_llm_and_tools(
55 llm=llm,
56 tools=tools,
57 prompt=prompt,
58 human_message_template=agent_kwargs.get("human_message_template", None),
59 input_variables=agent_kwargs.get("input_variables", None),
60 )
61 agent_executor = AgentExecutor.from_agent_and_tools(
62 agent=agent, tools=tools, verbose=verbose
63 )
64 return agent_executor

Callers 1

mainFunction · 0.90

Calls 2

from_agent_and_toolsMethod · 0.80
from_llm_and_toolsMethod · 0.45

Tested by

no test coverage detected