<@U084APK40NS> for an agent to properly end a call...
# ask-ai
s
@millions-hair-24956 for an agent to properly end a call. do we need to instruct it to use the callable in the system prompt?
g
It seems likely that to properly end a call using an agent, you would need to define a function call that the agent can trigger when the session should end. According to LiveKit documentation, you can use a function call to detect the intent to end the session and then execute the necessary API call to disconnect the room. This approach ensures that the agent can handle the session termination based on specific user interactions or conditions. Would you like more details on how to set up this function call or integrate it into your system prompt? Sources: - https://livekit-users.slack.com/archives/C07FRP66XGE/p1733329965.344829 - https://livekit-users.slack.com/archives/C07FY8WHGPM/p1731862459.531309 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@millions-hair-24956 yes so my agent has an end_call callable. @llm.ai_callable() async def *end_call*(self): """Called when the user wants to end the call""" print(f"Ending call for {self.participant.identity}") _# Finalize the conversation with agent_disconnected reason_ await self.finalize_conversation("agent_disconnected") # Proceed to hang up the call await self.hangup() print("Call ended.") Do i put in the system prompt to use end_call when the call has to end?
g
It seems likely that you should include guidance in the system prompt to use the
end_call
function when the call needs to end. This can help the LLM understand when to trigger the function based on user interactions. According to LiveKit documentation, you can define function calls that the LLM can use to perform specific actions, such as ending a call. Would you like more detailed guidance on how to structure the system prompt or integrate the function call? Sources: - LiveKit documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@millions-hair-24956 is there a way to dynamically generate first message
g
It seems likely that you can dynamically generate the first message by using a system prompt or initial context that incorporates dynamic data. According to LiveKit documentation, you can set up the
MultimodalAgent
with initial instructions that can include dynamic content, such as user-specific information or context from a database. Would you like more details on how to implement this in your setup? Sources: - LiveKit documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.