Skip to content

Realtime: handoffs #1139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 16, 2025
Merged

Realtime: handoffs #1139

merged 1 commit into from
Jul 16, 2025

Conversation

rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Jul 16, 2025

Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not sure if I am a right reviewer for this, but the changes look good to me

all_tools = await self._current_agent.get_all_tools(self._context_wrapper)
function_map = {tool.name: tool for tool in all_tools if isinstance(tool, FunctionTool)}
handoff_map = {tool.name: tool for tool in all_tools if isinstance(tool, Handoff)}
tools, handoffs = await asyncio.gather(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i like this optimization

@@ -239,12 +245,24 @@ async def _invoke_handoff(
# If there is a need, we can make this configurable in the future
input_json_schema = ensure_strict_json_schema(input_json_schema)

async def _is_enabled(ctx: RunContextWrapper[Any], agent_base: AgentBase[Any]) -> bool:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making this consistent looks good; with this, we may be able to switch the is_enabled property of the class object from Callable[[RunContextWrapper[Any], Agent[TContext]], MaybeAwaitable[bool]] to Callable[[..., ..., Awaitable[bool]] in future releases

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

@seratch seratch added enhancement New feature or request feature:realtime labels Jul 16, 2025
@rm-openai rm-openai merged commit 479c171 into main Jul 16, 2025
5 checks passed
@rm-openai rm-openai deleted the rm/pr1139 branch July 16, 2025 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature:realtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants