mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-14 23:26:34 +00:00
fix(core): fix docstrings and add sleep to FakeListChatModel._call (#32108)
This commit is contained in:
parent
f7d1b1fbb1
commit
6d71bb83de
@ -63,9 +63,9 @@ class FakeListChatModel(SimpleChatModel):
|
||||
"""List of responses to **cycle** through in order."""
|
||||
sleep: Optional[float] = None
|
||||
i: int = 0
|
||||
"""List of responses to **cycle** through in order."""
|
||||
error_on_chunk_number: Optional[int] = None
|
||||
"""Internally incremented after every model invocation."""
|
||||
error_on_chunk_number: Optional[int] = None
|
||||
"""If set, raise an error on the specified chunk number during streaming."""
|
||||
|
||||
@property
|
||||
@override
|
||||
@ -81,6 +81,8 @@ class FakeListChatModel(SimpleChatModel):
|
||||
**kwargs: Any,
|
||||
) -> str:
|
||||
"""First try to lookup in queries, else return 'foo' or 'bar'."""
|
||||
if self.sleep is not None:
|
||||
time.sleep(self.sleep)
|
||||
response = self.responses[self.i]
|
||||
if self.i < len(self.responses) - 1:
|
||||
self.i += 1
|
||||
|
Loading…
Reference in New Issue
Block a user