You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Write a short story about a robot learning to paint.",
1450
-
await_result=False
1450
+
await_result=False,
1451
+
strategy=None# Must disable strategy for streaming
1451
1452
)
1452
1453
1453
1454
# Stream the output - astream() returns accumulated value so far
@@ -1496,7 +1497,7 @@ async for chunk in thunk.astream(): # Stream the generation
1496
1497
1497
1498
Therefore, sync functions always await the result internally and return `ComputedModelOutputThunk`.
1498
1499
1499
-
**Streaming and sampling are incompatible**: When using `SamplingStrategy` or `return_sampling_results=True`, the function must await the complete result to perform validation. In these cases, the function always returns a computed result regardless of the `await_result` parameter.
1500
+
**Streaming and sampling are incompatible**: When using `SamplingStrategy` or `return_sampling_results=True`, the function must await the complete result to perform validation. In these cases, the function always returns a computed result regardless of the `await_result` parameter. To enable streaming, you must explicitly set `strategy=None` (the default is `RejectionSamplingStrategy(loop_budget=2)`).
0 commit comments