mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-24 10:35:09 +02:00
docs: __start__/__end__ consistency (#1874)
* changes * skip mermaid * retries fix * viz error * changes
This commit is contained in:
@@ -286,16 +286,16 @@
|
||||
" builder.add_edge(START, \"count_messages\")\n",
|
||||
" builder.add_edge(\"count_messages\", \"llm\")\n",
|
||||
"\n",
|
||||
" def route_validator(state: State) -> Literal[\"validator\", \"__end__\"]:\n",
|
||||
" def route_validator(state: State):\n",
|
||||
" if state[\"messages\"][-1].tool_calls or tool_choice is not None:\n",
|
||||
" return \"validator\"\n",
|
||||
" return \"__end__\"\n",
|
||||
" return END\n",
|
||||
"\n",
|
||||
" builder.add_conditional_edges(\"llm\", route_validator)\n",
|
||||
" builder.add_conditional_edges(\"llm\", route_validator, ['validator',END])\n",
|
||||
" builder.add_edge(\"fallback\", \"validator\")\n",
|
||||
" max_attempts = retry_strategy.get(\"max_attempts\", 3)\n",
|
||||
"\n",
|
||||
" def route_validation(state: State) -> Literal[\"finalizer\", \"fallback\"]:\n",
|
||||
" def route_validation(state: State):\n",
|
||||
" if state[\"attempt_number\"] > max_attempts:\n",
|
||||
" raise ValueError(\n",
|
||||
" f\"Could not extract a valid value in {max_attempts} attempts.\"\n",
|
||||
@@ -307,7 +307,7 @@
|
||||
" return \"fallback\"\n",
|
||||
" return \"finalizer\"\n",
|
||||
"\n",
|
||||
" builder.add_conditional_edges(\"validator\", route_validation)\n",
|
||||
" builder.add_conditional_edges(\"validator\", route_validation, [\"finalizer\", \"fallback\"])\n",
|
||||
"\n",
|
||||
" builder.add_edge(\"finalizer\", END)\n",
|
||||
"\n",
|
||||
|
||||
Reference in New Issue
Block a user