mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-21 06:58:02 +00:00
core: typo in runnable (#28815)
Thank you for contributing to LangChain! **Description:** Typo
This commit is contained in:
parent
c823cc532d
commit
51b8ddaf10
@ -190,7 +190,7 @@ class Runnable(Generic[Input, Output], ABC):
|
||||
|
||||
|
||||
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 @@ class Runnable(Generic[Input, Output], ABC):
|
||||
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 @@ class Runnable(Generic[Input, Output], ABC):
|
||||
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 @@ class Runnable(Generic[Input, Output], ABC):
|
||||
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'}}}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user