Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

fix example code in streamify docstring (#8099)

TomuHirata79021585d9ea
diff --git a/dspy/streaming/streamify.py b/dspy/streaming/streamify.py
index 4d4f8bedf..1a91af6d2 100644
--- a/dspy/streaming/streamify.py
+++ b/dspy/streaming/streamify.py
@@ -128,7 +128,10 @@ def streamify(
)
return_value = None
async for value in output:
- print(value)
+ if isinstance(value, dspy.Prediction):
+ return_value = value
+ else:
+ print(value)
return return_value
output = asyncio.run(use_streaming())