Skip to content

Commit

Permalink
core: typo in runnable (#28815)
Browse files Browse the repository at this point in the history
Thank you for contributing to LangChain!

**Description:** Typo
  • Loading branch information
WrRan authored Dec 19, 2024
1 parent c823cc5 commit 51b8dda
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions libs/core/langchain_core/runnables/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'}}}
Expand Down

0 comments on commit 51b8dda

Please sign in to comment.