这是用户在 2024-7-29 10:30 为 https://langchain-ai.github.io/langgraph/reference/errors/ 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?
Skip to content  跳到内容

Errors 错误

While you may not want to see them, informative errors help you design better workflows. Below are the LangGraph-specific errors and what they mean.
虽然您可能不想看到它们,但信息性错误可以帮助您设计更好的工作流程。以下是特定于 LangGraph 的错误及其含义。

GraphRecursionError

Bases: RecursionError
基数:RecursionError

Raised when the graph has exhausted the maximum number of steps.
当图形用尽最大步数时引发。

This prevents infinite loops. To increase the maximum number of steps, run your graph with a config specifying a higher recursion_limit.
这样可以防止无限循环。要增加最大步骤数,请使用指定更高recursion_limit的配置运行图形。

Examples: 例子:

graph = builder.compile()
graph.invoke(
    {"messages": [("user", "Hello, world!")]},
    # The config is the second positional argument
    {"recursion_limit": 1000},
)
Source code in libs/langgraph/langgraph/errors.py
libs/langgraph/langgraph/errors.py 中的源代码
class GraphRecursionError(RecursionError):
    """Raised when the graph has exhausted the maximum number of steps.

    This prevents infinite loops. To increase the maximum number of steps,
    run your graph with a config specifying a higher `recursion_limit`.

    Examples:

        graph = builder.compile()
        graph.invoke(
            {"messages": [("user", "Hello, world!")]},
            # The config is the second positional argument
            {"recursion_limit": 1000},
        )
    """

    pass

EmptyChannelError

Bases: Exception
基地:异常

Raised when attempting to get the value of a channel that hasn't been updated for the first time yet.
在尝试获取尚未首次更新的频道的值时引发。

Source code in libs/langgraph/langgraph/errors.py
libs/langgraph/langgraph/errors.py 中的源代码
class EmptyChannelError(Exception):
    """Raised when attempting to get the value of a channel that hasn't been updated
    for the first time yet."""

    pass

InvalidUpdateError

Bases: Exception
基地:异常

Raised when attempting to update a channel with an invalid sequence of updates.
在尝试使用无效的更新序列更新频道时引发。

Source code in libs/langgraph/langgraph/errors.py
libs/langgraph/langgraph/errors.py 中的源代码
class InvalidUpdateError(Exception):
    """Raised when attempting to update a channel with an invalid sequence of updates."""

    pass

GraphInterrupt
GraphInterrupt 函数 ¶

Bases: Exception
基地:异常

Raised when a subgraph is interrupted.
当子图被中断时引发。

Source code in libs/langgraph/langgraph/errors.py
libs/langgraph/langgraph/errors.py 中的源代码
class GraphInterrupt(Exception):
    """Raised when a subgraph is interrupted."""

    pass

EmptyInputError

Bases: Exception
基地:异常

Raised when graph receives an empty input.
当图形接收到空输入时引发。

Source code in libs/langgraph/langgraph/errors.py
libs/langgraph/langgraph/errors.py 中的源代码
class EmptyInputError(Exception):
    """Raised when graph receives an empty input."""

    pass

Comments 评论