mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-25 17:12:26 +02:00
docs: __start__/__end__ consistency (#1874)
* changes * skip mermaid * retries fix * viz error * changes
This commit is contained in:
@@ -62,6 +62,9 @@ def is_magic_command(code: str) -> bool:
|
||||
def is_comment(code: str) -> bool:
|
||||
return code.strip().startswith("#")
|
||||
|
||||
def is_mermaid_command(code: str) -> bool:
|
||||
return "draw_mermaid_png" in code.strip()
|
||||
|
||||
|
||||
def add_vcr_to_notebook(
|
||||
notebook: nbformat.NotebookNode, cassette_prefix: str
|
||||
@@ -84,6 +87,10 @@ def add_vcr_to_notebook(
|
||||
if all(are_magic_lines):
|
||||
continue
|
||||
|
||||
# skip if using mermaid
|
||||
if any(is_mermaid_command(line) for line in lines):
|
||||
continue
|
||||
|
||||
if any(are_magic_lines):
|
||||
raise ValueError(
|
||||
"Cannot process code cells with mixed magic and non-magic code."
|
||||
|
||||
Reference in New Issue
Block a user