We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4d384a commit aa74a7cCopy full SHA for aa74a7c
pydantic_graph/pydantic_graph/graph.py
@@ -542,7 +542,15 @@ def is_ended(self):
542
@property
543
def result(self) -> RunEndT:
544
if self._result is None:
545
- raise exceptions.GraphRuntimeError('GraphRun has not ended yet.')
+ if self._started:
546
+ raise exceptions.GraphRuntimeError(
547
+ 'This GraphRun has not yet ended. Continue iterating with `async for` or `GraphRun.next`'
548
+ ' to complete the run before accessing the result.'
549
+ )
550
+ else:
551
552
+ 'This GraphRun has not been started. Did you forget to `await` the run?'
553
554
return self._result.data
555
556
async def next(
0 commit comments