langchain/docs/snippets/modules/agents/how_to
Nir Gazit 95b77a5215
Fix Custom LLM Agent example (#6429)
<!--
Thank you for contributing to LangChain! Your PR will appear in our
release under the title you set. Please make sure it highlights your
valuable contribution.

Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.

After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd
like us to shout you out on Twitter, please also include your handle!
-->

The `CustomOutputParser` needs to throw `OutputParserException` when it
fails to parse the response from the agent, so that the executor can
[catch it and
retry](be9371ca8f/langchain/agents/agent.py (L767))
when `handle_parsing_errors=True`.

<!-- Remove if not applicable -->

#### Who can review?

Tag maintainers/contributors who might be interested: @hwchase17

<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead

  Tracing / Callbacks
  - @agola11

  Async
  - @agola11

  DataLoaders
  - @eyurtsev

  Models
  - @hwchase17
  - @agola11

  Agents / Tools / Toolkits
  - @hwchase17

  VectorStores / Retrievers / Memory
  - @dev2049

 -->
2023-06-19 22:03:58 -07:00
..
custom_llm_agent.mdx Fix Custom LLM Agent example (#6429) 2023-06-19 22:03:58 -07:00
custom_llm_chat_agent.mdx Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
mrkl_chat.mdx Doc refactor (#6300) 2023-06-16 11:52:56 -07:00
mrkl.mdx Doc refactor (#6300) 2023-06-16 11:52:56 -07:00