MCPcopy
hub / github.com/openai/openai-agents-python / run

Method run

src/agents/voice/workflow.py:80–101  ·  view source on GitHub ↗
(self, transcription: str)

Source from the content-addressed store, hash-verified

78 self._callbacks = callbacks
79
80 async def run(self, transcription: str) -> AsyncIterator[str]:
81 if self._callbacks:
82 self._callbacks.on_run(self, transcription)
83
84 # Add the transcription to the input history
85 self._input_history.append(
86 {
87 "role": "user",
88 "content": transcription,
89 }
90 )
91
92 # Run the agent
93 result = Runner.run_streamed(self._current_agent, self._input_history)
94
95 # Stream the text from the result
96 async for chunk in VoiceWorkflowHelper.stream_text_from(result):
97 yield chunk
98
99 # Update the input history and current agent
100 self._input_history = result.to_input_list()
101 self._current_agent = result.last_agent

Callers 1

Calls 5

appendMethod · 0.80
stream_text_fromMethod · 0.80
on_runMethod · 0.45
run_streamedMethod · 0.45
to_input_listMethod · 0.45

Tested by 1