AgentsSkills

play_background_file

View as MarkdownOpen in Claude

Control background file playback during calls. A single tool handles both starting and stopping playback via an action parameter with dynamic enum values generated from the configured file list. Supports audio and video files.

Tools: play_background_file (default, customizable via tool_name)

Requirements: None (files must be accessible via URL)

Multi-instance: Yes (use different tool_name per instance)

files
list[dict]Required

Array of file configurations to make available for playback. Each object must include:

  • key (str, required) — Unique identifier for the file (alphanumeric, underscores, hyphens).
  • description (str, required) — Human-readable description of the file.
  • url (str, required) — URL of the audio/video file to play.
  • wait (bool, optional, default False) — Whether to wait for the file to finish playing.
from signalwire import AgentBase
class MyAgent(AgentBase):
def __init__(self):
super().__init__(name="assistant", route="/assistant")
self.set_prompt_text("You are a helpful assistant.")
self.add_skill("play_background_file", {
"tool_name": "play_testimonial",
"files": [
{
"key": "massey",
"description": "Customer success story from Massey Energy",
"url": "https://example.com/massey.mp4",
"wait": True
}
]
})
agent = MyAgent()
agent.serve()