Update default recursion_limit, update docs (#12134)

<!-- Thank you for contributing to LangChain!

Replace this entire comment with:
  - **Description:** a description of the change, 
  - **Issue:** the issue # it fixes (if applicable),
  - **Dependencies:** any dependencies required for this change,
- **Tag maintainer:** for a quicker response, tag the relevant
maintainer (see below),
- **Twitter handle:** we announce bigger features on Twitter. If your PR
gets announced, and you'd like a mention, we'll gladly shout you out!

Please make sure your PR is passing linting and testing before
submitting. Run `make format`, `make lint` and `make test` to check this
locally.

See contribution guidelines for more information on how to write/run
tests, lint, etc:

https://github.com/langchain-ai/langchain/blob/master/.github/CONTRIBUTING.md

If you're adding a new integration, please include:
1. a test for the integration, preferably unit tests that do not rely on
network access,
2. an example notebook showing its use. It lives in `docs/extras`
directory.

If no one reviews your PR within a few days, please @-mention one of
@baskaryan, @eyurtsev, @hwchase17.
 -->
This commit is contained in:
Nuno Campos 2023-10-23 16:29:17 +01:00 committed by GitHub
parent 4f23aa677a
commit d0505c0d47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -74,19 +74,20 @@ class RunnableConfig(TypedDict, total=False):
max_concurrency: Optional[int] max_concurrency: Optional[int]
""" """
Maximum number of parallel calls to make. If not provided, defaults to Maximum number of parallel calls to make. If not provided, defaults to
ThreadPoolExecutor's default. This is ignored if an executor is provided. ThreadPoolExecutor's default.
""" """
recursion_limit: int recursion_limit: int
""" """
Maximum number of times a call can recurse. If not provided, defaults to 10. Maximum number of times a call can recurse. If not provided, defaults to 25.
""" """
configurable: Dict[str, Any] configurable: Dict[str, Any]
""" """
Runtime values for attributes previously made configurable by this Runnable, Runtime values for attributes previously made configurable on this Runnable,
or sub-Runnables, through .make_configurable(). Check .output_schema for or sub-Runnables, through .configurable_fields() or .configurable_alternatives().
a description of the attributes that have been made configurable. Check .output_schema() for a description of the attributes that have been made
configurable.
""" """
@ -96,7 +97,7 @@ def ensure_config(config: Optional[RunnableConfig] = None) -> RunnableConfig:
metadata={}, metadata={},
callbacks=None, callbacks=None,
locals={}, locals={},
recursion_limit=10, recursion_limit=25,
) )
if config is not None: if config is not None:
empty.update( empty.update(

View File

@ -1291,7 +1291,7 @@ async def test_default_method_implementations(mocker: MockerFixture) -> None:
tags=[], tags=[],
callbacks=None, callbacks=None,
locals={}, locals={},
recursion_limit=10, recursion_limit=25,
), ),
), ),
mocker.call( mocker.call(
@ -1301,7 +1301,7 @@ async def test_default_method_implementations(mocker: MockerFixture) -> None:
tags=[], tags=[],
callbacks=None, callbacks=None,
locals={}, locals={},
recursion_limit=10, recursion_limit=25,
), ),
), ),
] ]