mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-06 13:18:12 +00:00
Add error for batch of 0
This commit is contained in:
parent
3458489936
commit
db4b256a28
@ -238,6 +238,8 @@ class Runnable(Generic[Input, Output], ABC):
|
|||||||
Helper method to get a list of configs from a single config or a list of
|
Helper method to get a list of configs from a single config or a list of
|
||||||
configs, useful for subclasses overriding batch() or abatch().
|
configs, useful for subclasses overriding batch() or abatch().
|
||||||
"""
|
"""
|
||||||
|
if length < 1:
|
||||||
|
raise ValueError(f"length must be >= 1, but got {length}")
|
||||||
if isinstance(config, list) and len(config) != length:
|
if isinstance(config, list) and len(config) != length:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"config must be a list of the same length as inputs, "
|
f"config must be a list of the same length as inputs, "
|
||||||
|
Loading…
Reference in New Issue
Block a user