Skip to content

Commit 6e28b43

Browse files
authored
Merge pull request #4 from elementary-data/fix-checkpointer
Allow no checkpointer
2 parents cc8e129 + 9f5dafe commit 6e28b43

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ai_datastream/agent/langgraph/streamer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ def __init__(self, agent: CompiledGraph, thread_id: Union[str, None] = None):
3737
self.status = StreamStatus.INIT
3838

3939
def _handle_stream_finish(self) -> Generator[DataStreamPart, None, None]:
40-
snapshot = self.agent.get_state(self.config)
41-
if snapshot.next:
40+
try:
41+
snapshot = self.agent.get_state(self.config)
42+
except ValueError:
43+
snapshot = None
44+
if snapshot and snapshot.next:
4245
self.status = StreamStatus.INTERRUPTED
4346
return
4447
if self.converter.current_message_id is not None:

0 commit comments

Comments
 (0)