From b8648e84593ae54c53e0a7a64c8ce7d5bc156ad8 Mon Sep 17 00:00:00 2001 From: Andrew Malone <74384503+andrewdmalone@users.noreply.github.com> Date: Thu, 2 Jan 2025 05:18:40 -0600 Subject: [PATCH] Added troubleshooting section to the docs page (#583) Co-authored-by: Andrew Malone Co-authored-by: Samuel Colvin Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com> --- docs/agents.md | 10 ---------- docs/troubleshooting.md | 16 ++++++++++++++++ mkdocs.yml | 1 + 3 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 docs/troubleshooting.md diff --git a/docs/agents.md b/docs/agents.md index 0009564d..56f9dcc2 100644 --- a/docs/agents.md +++ b/docs/agents.md @@ -93,16 +93,6 @@ _(This example is complete, it can be run "as is")_ You can also pass messages from previous runs to continue a conversation or provide context, as described in [Messages and Chat History](message-history.md). -!!! note "jupyter notebooks" - If you're running `pydantic-ai` in a jupyter notebook, you might consider using [`nest-asyncio`](https://pypi.org/project/nest-asyncio/) - to manage conflicts between event loops that occur between jupyter's event loops and `pydantic-ai`'s. - - Before you execute any agent runs, do the following: - ```python {test="skip" lint="skip"} - import nest_asyncio - - nest_asyncio.apply() - ``` ### Additional Configuration diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md new file mode 100644 index 00000000..bc14834c --- /dev/null +++ b/docs/troubleshooting.md @@ -0,0 +1,16 @@ +# Troubleshooting + +Common/known issues are shown below with associated solutions. + +## Jupyter Notebooks + +If you're running `pydantic-ai` in a jupyter notebook, you might consider using [`nest-asyncio`](https://pypi.org/project/nest-asyncio/) +to manage conflicts between event loops that occur between Jupyter's event loops and `pydantic-ai`'s. + +Before you execute any agent runs, do the following: + +```python {test="skip" lint="skip"} +import nest_asyncio + +nest_asyncio.apply() +``` diff --git a/mkdocs.yml b/mkdocs.yml index e60e3a97..6fc07b39 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -14,6 +14,7 @@ nav: - install.md - help.md - contributing.md + - troubleshooting.md - Documentation: - agents.md - models.md