diff --git a/pipeline/core/builder.py b/pipeline/core/builder.py index a0ec66207..8185dd755 100644 --- a/pipeline/core/builder.py +++ b/pipeline/core/builder.py @@ -51,6 +51,7 @@ def __init__(self, src_dir: Path, build_dir: Path) -> None: ".yaml", ".css", ".js", + ".html", } # Mapping of language codes to full names for URLs @@ -152,8 +153,8 @@ def rewrite_link(match: re.Match) -> str: url = match.group(2) # The URL post = match.group(3) # Everything after the URL - # Only rewrite absolute /oss/ paths that don't contain 'images' - if url.startswith("/oss/") and "images" not in url: + # Only rewrite absolute /oss/ paths that don't contain 'images' or 'plugins' + if url.startswith("/oss/") and "images" not in url and "plugins" not in url: parts = url.split("/") # Insert full language name after "oss" parts.insert(2, self.language_url_names[target_language]) @@ -739,8 +740,11 @@ def is_shared_file(self, file_path: Path) -> bool: if "snippets" in relative_path.parts: return True + if "plugins" in relative_path.parts: + return True + # JavaScript and CSS files should be shared (used for custom scripts/styles) - return file_path.suffix.lower() in {".js", ".css"} + return file_path.suffix.lower() in {".js", ".css", ".html", ".json"} def _copy_shared_files(self) -> None: """Copy files that should be shared between versions.""" diff --git a/pyproject.toml b/pyproject.toml index 4231dbe5f..b9abdd8cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,8 @@ asyncio_default_fixture_loop_scope = "function" line-length = 88 extend-exclude = [ "scripts/update_mdx.py", - "pipeline/tools/notebook/convert.py" + "pipeline/tools/notebook/convert.py", + "src/plugins/middleware_visualization/generate_middleware_diagrams.py" ] @@ -133,3 +134,9 @@ ignore = [ [tool.ruff.lint.pydocstyle] convention = "google" + + +[tool.mypy] +exclude = [ + "src/plugins/middleware_visualization/generate_middleware_diagrams.py", +] diff --git a/src/oss/langchain/agents.mdx b/src/oss/langchain/agents.mdx index 32d14582b..a6ae27480 100644 --- a/src/oss/langchain/agents.mdx +++ b/src/oss/langchain/agents.mdx @@ -746,3 +746,22 @@ For comprehensive middleware documentation including decorators like `@before_mo For comprehensive middleware documentation including hooks like `beforeModel`, `afterModel`, and `wrapToolCall`, see [Middleware](/oss/langchain/middleware). ::: + +### Visualizing agents + +The interactive widget below shows how middleware hooks integrate into the agent execution flow. Toggle different hook combinations to see how they affect the agent's graph structure: + +