It's my third attempt at trying to make this work,...
# agents
b
It's my third attempt at trying to make this work, I want my agent to say things to the user before shutting down, in my
instructions
I have this prompt `".... if the user wants to end the call, say that they can continue on the app later, wish them a good they and use 'end_call' to end the call"
Copy code
@function_tool()
    async def end_call(self) -> None:
        """Use this tool to end the call."""
        current_speech = self.session.current_speech
        if current_speech:
            await current_speech
        self._closing_task = asyncio.create_task(self.session.aclose())
        get_job_context().shutdown()
        return None
Here is the function_tool but sometimes the agent never says anything and ends abruptly, sometimes it ends mid-sentence, sometimes it works as intended, does anyone have any idea? I'm using gemini-live realtime models.