diff --git a/libs/core/langchain_core/runnables/base.py b/libs/core/langchain_core/runnables/base.py index e6a61fdfc77e8..3e43fb10a8e6b 100644 --- a/libs/core/langchain_core/runnables/base.py +++ b/libs/core/langchain_core/runnables/base.py @@ -190,7 +190,7 @@ def add_one(x: int) -> int: def buggy_double(y: int) -> int: - '''Buggy code that will fail 70% of the time''' + \"\"\"Buggy code that will fail 70% of the time\"\"\" if random.random() > 0.3: print('This code failed, and will probably be retried!') # noqa: T201 raise ValueError('Triggered buggy code') @@ -520,13 +520,13 @@ def config_schema( def get_config_jsonschema( self, *, include: Optional[Sequence[str]] = None ) -> dict[str, Any]: - """Get a JSON schema that represents the output of the Runnable. + """Get a JSON schema that represents the config of the Runnable. Args: include: A list of fields to include in the config schema. Returns: - A JSON schema that represents the output of the Runnable. + A JSON schema that represents the config of the Runnable. .. versionadded:: 0.3.0 """ @@ -625,7 +625,7 @@ def mul_two(x: int) -> int: return RunnableSequence(self, *others, name=name) def pick(self, keys: Union[str, list[str]]) -> RunnableSerializable[Any, Any]: - """Pick keys from the dict output of this Runnable. + """Pick keys from the output dict of this Runnable. Pick single key: .. code-block:: python @@ -712,8 +712,8 @@ def assign( print(chain_with_assign.input_schema.model_json_schema()) # {'title': 'PromptInput', 'type': 'object', 'properties': {'question': {'title': 'Question', 'type': 'string'}}} - print(chain_with_assign.output_schema.model_json_schema()) # - {'title': 'RunnableSequenceOutput', 'type': 'object', 'properties': + print(chain_with_assign.output_schema.model_json_schema()) + # {'title': 'RunnableSequenceOutput', 'type': 'object', 'properties': {'str': {'title': 'Str', 'type': 'string'}, 'hello': {'title': 'Hello', 'type': 'string'}}}