Skip to content

Commit 946a685

Browse files
revert interactive diagram (#860)
not rendering properly live at the moment, going to revert for now and can debug later
1 parent b9c6486 commit 946a685

File tree

9 files changed

+17
-748
lines changed

9 files changed

+17
-748
lines changed

β€Žpipeline/core/builder.pyβ€Ž

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(self, src_dir: Path, build_dir: Path) -> None:
5151
".yaml",
5252
".css",
5353
".js",
54-
".html",
5554
}
5655

5756
# Mapping of language codes to full names for URLs
@@ -157,8 +156,8 @@ def rewrite_link(match: re.Match) -> str:
157156
url = match.group(2) # The URL
158157
post = match.group(3) # Everything after the URL
159158

160-
# Only rewrite absolute /oss/ paths that don't contain 'images' or 'plugins'
161-
if url.startswith("/oss/") and "images" not in url and "plugins" not in url:
159+
# Only rewrite absolute /oss/ paths that don't contain 'images'
160+
if url.startswith("/oss/") and "images" not in url:
162161
parts = url.split("/")
163162
# Insert full language name after "oss"
164163
parts.insert(2, self.language_url_names[target_language])
@@ -744,11 +743,8 @@ def is_shared_file(self, file_path: Path) -> bool:
744743
if "snippets" in relative_path.parts:
745744
return True
746745

747-
if "plugins" in relative_path.parts:
748-
return True
749-
750746
# JavaScript and CSS files should be shared (used for custom scripts/styles)
751-
return file_path.suffix.lower() in {".js", ".css", ".html", ".json"}
747+
return file_path.suffix.lower() in {".js", ".css"}
752748

753749
def _copy_shared_files(self) -> None:
754750
"""Copy files that should be shared between versions."""

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ asyncio_default_fixture_loop_scope = "function"
7070
line-length = 88
7171
extend-exclude = [
7272
"scripts/update_mdx.py",
73-
"pipeline/tools/notebook/convert.py",
74-
"src/plugins/middleware_visualization/generate_middleware_diagrams.py"
73+
"pipeline/tools/notebook/convert.py"
7574
]
7675

7776

@@ -134,9 +133,3 @@ ignore = [
134133

135134
[tool.ruff.lint.pydocstyle]
136135
convention = "google"
137-
138-
139-
[tool.mypy]
140-
exclude = [
141-
"src/plugins/middleware_visualization/generate_middleware_diagrams.py",
142-
]

β€Žsrc/oss/langchain/middleware.mdxβ€Ž

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -877,15 +877,21 @@ Build custom middleware by implementing hooks that run at specific points in the
877877

878878
#### Node-style hooks
879879

880-
Run at specific points in the execution flow.
880+
Run at specific points in the execution flow:
881881

882-
**Try it:** The interactive widget below shows all available hooks and lets you toggle different combinations to see how they affect the agent execution graph:
882+
:::python
883+
- `before_agent` - Before agent starts (once per invocation)
884+
- `before_model` - Before each model call
885+
- `after_model` - After each model response
886+
- `after_agent` - After agent completes (up to once per invocation)
887+
:::
883888

884-
<iframe
885-
src="/plugins/middleware_visualization/index.html"
886-
style={{ width: "100%", height: "600px", border: "none" }}
887-
title="Interactive Middleware Visualizer"
888-
/>
889+
:::js
890+
- `beforeAgent` - Before agent starts (once per invocation)
891+
- `beforeModel` - Before each model call
892+
- `afterModel` - After each model response
893+
- `afterAgent` - After agent completes (up to once per invocation)
894+
:::
889895

890896
**Example: Logging middleware**
891897

β€Žsrc/plugins/middleware_visualization/README.mdβ€Ž

Lines changed: 0 additions & 63 deletions
This file was deleted.

β€Žsrc/plugins/middleware_visualization/diagrams_js.jsβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

β€Žsrc/plugins/middleware_visualization/diagrams_python.jsβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
Β (0)