Skip to content

Commit 5f6ad04

Browse files
committed
Enabling replay (WIP)
1 parent eb727a3 commit 5f6ad04

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

samples-v2/openai_agents/durable_model_stub.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ def make_tool_info(tool: Tool) -> ToolInput:
132132
# Serialize activity_input to JSON
133133
activity_input_json = activity_input.to_json()
134134

135-
activity_output = self.durable_orchestration_context.call_activity(
135+
task = self.durable_orchestration_context.call_activity(
136136
"invoke_model_activity",
137137
activity_input_json
138138
)
139139

140-
raise OrchestratorYielded(activity_output)
140+
if not self.durable_orchestration_context.is_replaying:
141+
raise OrchestratorYielded(task)
142+
143+
result = task.result
144+
return result
141145

142146
def stream_response(
143147
self,

0 commit comments

Comments
 (0)