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.
1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="assistant", route="/assistant")
6 self.set_prompt_text("You are a helpful assistant.")
7 self.add_skill("play_background_file", {
8 "tool_name": "play_testimonial",
9 "files": [
10 {
11 "key": "massey",
12 "description": "Customer success story from Massey Energy",
13 "url": "https://example.com/massey.mp4",
14 "wait": True
15 }
16 ]
17 })
18
19agent = MyAgent()
20agent.serve()