User-friendly way to initialize the MRKL chain. This is intended to be an easy way to get up and running with the MRKL chain. Args: llm: The LLM to use as the agent LLM. chains: The chains the MRKL system has access to. **kwargs: paramete
(
cls, llm: BaseLanguageModel, chains: List[ChainConfig], **kwargs: Any
)
| 174 | |
| 175 | @classmethod |
| 176 | def from_chains( |
| 177 | cls, llm: BaseLanguageModel, chains: List[ChainConfig], **kwargs: Any |
| 178 | ) -> AgentExecutor: |
| 179 | """User-friendly way to initialize the MRKL chain. |
| 180 | |
| 181 | This is intended to be an easy way to get up and running with the |
| 182 | MRKL chain. |
| 183 | |
| 184 | Args: |
| 185 | llm: The LLM to use as the agent LLM. |
| 186 | chains: The chains the MRKL system has access to. |
| 187 | **kwargs: parameters to be passed to initialization. |
| 188 | |
| 189 | Returns: |
| 190 | An initialized MRKL chain. |
| 191 | """ |
| 192 | tools = [ |
| 193 | Tool( |
| 194 | name=c.action_name, |
| 195 | func=c.action, |
| 196 | description=c.action_description, |
| 197 | ) |
| 198 | for c in chains |
| 199 | ] |
| 200 | agent = ZeroShotAgent.from_llm_and_tools(llm, tools) |
| 201 | return cls(agent=agent, tools=tools, **kwargs) |
nothing calls this directly
no test coverage detected