Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,8 @@ def run_stream(
try:
current_run_id = None
yield_run_output_set = False
if "yield_run_output" not in kwargs:
if kwargs.get("yield_run_output") or kwargs.get("yield_run_response"):
yield_run_output_set = True
kwargs["yield_run_output"] = True # type: ignore

run_response = None
with trace_api.use_span(span, end_on_exit=False):
Expand All @@ -361,7 +360,7 @@ def run_stream(

if isinstance(response, (RunOutput, TeamRunOutput)):
run_response = response
if yield_run_output_set:
if not yield_run_output_set:
continue

yield response
Expand Down Expand Up @@ -503,9 +502,8 @@ async def arun_stream(
try:
current_run_id = None
yield_run_output_set = False
if "yield_run_output" not in kwargs:
if kwargs.get("yield_run_output") or kwargs.get("yield_run_response"):
yield_run_output_set = True
kwargs["yield_run_output"] = True # type: ignore
run_response = None
with trace_api.use_span(span, end_on_exit=False):
team_token, team_ctx = _setup_team_context(instance, node_id)
Expand All @@ -517,7 +515,7 @@ async def arun_stream(

if isinstance(response, (RunOutput, TeamRunOutput)):
run_response = response
if yield_run_output_set:
if not yield_run_output_set:
continue

yield response
Expand Down