signalwire-agents 0.1.7__tar.gz → 0.1.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {signalwire_agents-0.1.7/signalwire_agents.egg-info → signalwire_agents-0.1.9}/PKG-INFO +113 -2
  2. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/README.md +110 -1
  3. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/pyproject.toml +4 -2
  4. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/__init__.py +4 -1
  5. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/agent_base.py +305 -41
  6. signalwire_agents-0.1.9/signalwire_agents/core/function_result.py +1153 -0
  7. signalwire_agents-0.1.9/signalwire_agents/core/skill_base.py +87 -0
  8. signalwire_agents-0.1.9/signalwire_agents/core/skill_manager.py +136 -0
  9. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/swml_builder.py +5 -1
  10. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/prefabs/info_gatherer.py +149 -33
  11. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/prefabs/receptionist.py +14 -22
  12. signalwire_agents-0.1.9/signalwire_agents/skills/__init__.py +14 -0
  13. signalwire_agents-0.1.9/signalwire_agents/skills/datetime/__init__.py +1 -0
  14. signalwire_agents-0.1.9/signalwire_agents/skills/datetime/skill.py +109 -0
  15. signalwire_agents-0.1.9/signalwire_agents/skills/math/__init__.py +1 -0
  16. signalwire_agents-0.1.9/signalwire_agents/skills/math/skill.py +88 -0
  17. signalwire_agents-0.1.9/signalwire_agents/skills/registry.py +98 -0
  18. signalwire_agents-0.1.9/signalwire_agents/skills/web_search/__init__.py +1 -0
  19. signalwire_agents-0.1.9/signalwire_agents/skills/web_search/skill.py +240 -0
  20. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9/signalwire_agents.egg-info}/PKG-INFO +113 -2
  21. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents.egg-info/SOURCES.txt +10 -0
  22. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents.egg-info/requires.txt +2 -0
  23. signalwire_agents-0.1.7/signalwire_agents/core/function_result.py +0 -123
  24. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/LICENSE +0 -0
  25. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/schema.json +0 -0
  26. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/setup.cfg +0 -0
  27. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/setup.py +0 -0
  28. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/agent_server.py +0 -0
  29. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/__init__.py +0 -0
  30. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/pom_builder.py +0 -0
  31. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/security/__init__.py +0 -0
  32. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/security/session_manager.py +0 -0
  33. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/state/__init__.py +0 -0
  34. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/state/file_state_manager.py +0 -0
  35. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/state/state_manager.py +0 -0
  36. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/swaig_function.py +0 -0
  37. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/swml_handler.py +0 -0
  38. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/swml_renderer.py +0 -0
  39. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/core/swml_service.py +0 -0
  40. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/prefabs/__init__.py +0 -0
  41. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/prefabs/concierge.py +0 -0
  42. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/prefabs/faq_bot.py +0 -0
  43. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/prefabs/survey.py +0 -0
  44. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/schema.json +0 -0
  45. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/utils/__init__.py +0 -0
  46. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/utils/pom_utils.py +0 -0
  47. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/utils/schema_utils.py +0 -0
  48. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/utils/token_generators.py +0 -0
  49. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents/utils/validators.py +0 -0
  50. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents.egg-info/dependency_links.txt +0 -0
  51. {signalwire_agents-0.1.7 → signalwire_agents-0.1.9}/signalwire_agents.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: signalwire_agents
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: SignalWire AI Agents SDK
5
5
  Author-email: SignalWire Team <info@signalwire.com>
6
6
  Project-URL: Homepage, https://github.com/signalwire/signalwire-ai-agents
@@ -24,6 +24,8 @@ Requires-Dist: setuptools==66.1.1
24
24
  Requires-Dist: signalwire_pom==2.7.1
25
25
  Requires-Dist: structlog==25.3.0
26
26
  Requires-Dist: uvicorn==0.34.2
27
+ Requires-Dist: beautifulsoup4==4.12.3
28
+ Requires-Dist: pytz==2023.3
27
29
  Dynamic: license-file
28
30
 
29
31
  # SignalWire AI Agent SDK
@@ -35,12 +37,54 @@ A Python SDK for creating, hosting, and securing SignalWire AI agents as microse
35
37
  - **Self-Contained Agents**: Each agent is both a web app and an AI persona
36
38
  - **Prompt Object Model**: Structured prompt composition using POM
37
39
  - **SWAIG Integration**: Easily define and handle AI tools/functions
40
+ - **Dynamic Configuration**: Configure agents per-request for multi-tenant apps and personalization
38
41
  - **Custom Routing**: Dynamic request handling for different paths and content
39
42
  - **SIP Integration**: Route SIP calls to agents based on SIP usernames
40
43
  - **Security Built-In**: Session management, function-specific security tokens, and basic auth
41
44
  - **State Management**: Persistent conversation state with automatic tracking
42
45
  - **Prefab Archetypes**: Ready-to-use agent types for common scenarios
43
46
  - **Multi-Agent Support**: Host multiple agents on a single server
47
+ - **Modular Skills System**: Add capabilities to agents with simple one-liner calls
48
+
49
+ ## Skills System
50
+
51
+ The SignalWire Agents SDK includes a powerful modular skills system that allows you to add complex capabilities to your agents with simple one-liner calls:
52
+
53
+ ```python
54
+ from signalwire_agents import AgentBase
55
+
56
+ # Create an agent
57
+ agent = AgentBase("My Assistant", route="/assistant")
58
+
59
+ # Add skills with one-liners
60
+ agent.add_skill("web_search") # Web search capability
61
+ agent.add_skill("datetime") # Current date/time info
62
+ agent.add_skill("math") # Mathematical calculations
63
+
64
+ # Configure skills with parameters
65
+ agent.add_skill("web_search", {
66
+ "num_results": 3, # Get 3 search results
67
+ "delay": 0.5 # Small delay between requests
68
+ })
69
+
70
+ agent.serve()
71
+ ```
72
+
73
+ ### Available Built-in Skills
74
+
75
+ - **web_search**: Google Custom Search API integration with web scraping
76
+ - **datetime**: Current date and time with timezone support
77
+ - **math**: Safe mathematical expression evaluation
78
+
79
+ ### Benefits
80
+
81
+ - **One-liner integration**: `agent.add_skill("skill_name")`
82
+ - **Configurable parameters**: `agent.add_skill("skill_name", {"param": "value"})`
83
+ - **Automatic discovery**: Skills are automatically found from the skills directory
84
+ - **Dependency validation**: Clear error messages for missing requirements
85
+ - **Modular architecture**: Skills are self-contained and reusable
86
+
87
+ For detailed documentation, see [Skills System README](docs/SKILLS_SYSTEM_README.md).
44
88
 
45
89
  ## Installation
46
90
 
@@ -165,6 +209,73 @@ Available prefabs include:
165
209
  - `FAQBotAgent`: Answers questions based on a knowledge base
166
210
  - `ConciergeAgent`: Routes users to specialized agents
167
211
  - `SurveyAgent`: Conducts structured surveys with questions and rating scales
212
+ - `ReceptionistAgent`: Greets callers and transfers them to appropriate departments
213
+
214
+ ## Dynamic Agent Configuration
215
+
216
+ Configure agents dynamically based on request parameters for multi-tenant applications, A/B testing, and personalization.
217
+
218
+ ### Static vs Dynamic Configuration
219
+
220
+ - **Static**: Agent configured once at startup (traditional approach)
221
+ - **Dynamic**: Agent configured fresh for each request based on parameters
222
+
223
+ ### Basic Example
224
+
225
+ ```python
226
+ from signalwire_agents import AgentBase
227
+
228
+ class DynamicAgent(AgentBase):
229
+ def __init__(self):
230
+ super().__init__(name="dynamic-agent", route="/dynamic")
231
+
232
+ # Set up dynamic configuration callback
233
+ self.set_dynamic_config_callback(self.configure_per_request)
234
+
235
+ def configure_per_request(self, query_params, body_params, headers, agent):
236
+ """Configure agent based on request parameters"""
237
+
238
+ # Extract parameters from request
239
+ tier = query_params.get('tier', 'standard')
240
+ language = query_params.get('language', 'en')
241
+ customer_id = query_params.get('customer_id')
242
+
243
+ # Configure voice and language
244
+ if language == 'es':
245
+ agent.add_language("Spanish", "es-ES", "rime.spore:mistv2")
246
+ else:
247
+ agent.add_language("English", "en-US", "rime.spore:mistv2")
248
+
249
+ # Configure based on service tier
250
+ if tier == 'premium':
251
+ agent.set_params({"end_of_speech_timeout": 300}) # Faster response
252
+ agent.prompt_add_section("Service Level", "You provide premium support.")
253
+ else:
254
+ agent.set_params({"end_of_speech_timeout": 500}) # Standard response
255
+ agent.prompt_add_section("Service Level", "You provide standard support.")
256
+
257
+ # Personalize with customer data
258
+ global_data = {"tier": tier, "language": language}
259
+ if customer_id:
260
+ global_data["customer_id"] = customer_id
261
+ agent.set_global_data(global_data)
262
+
263
+ # Usage examples:
264
+ # curl "http://localhost:3000/dynamic?tier=premium&language=es&customer_id=123"
265
+ # curl "http://localhost:3000/dynamic?tier=standard&language=en"
266
+ ```
267
+
268
+ ### Use Cases
269
+
270
+ - **Multi-tenant SaaS**: Different configurations per customer/organization
271
+ - **A/B Testing**: Test different agent behaviors with different user groups
272
+ - **Personalization**: Customize voice, prompts, and behavior per user
273
+ - **Localization**: Language and cultural adaptation based on user location
274
+ - **Dynamic Pricing**: Adjust features and capabilities based on subscription tiers
275
+
276
+ The `EphemeralAgentConfig` object provides all the same familiar methods as `AgentBase` (like `add_language()`, `prompt_add_section()`, `set_global_data()`) but applies them per-request instead of at startup.
277
+
278
+ For detailed documentation and advanced examples, see the [Agent Guide](docs/agent_guide.md#dynamic-agent-configuration).
168
279
 
169
280
  ## Configuration
170
281
 
@@ -189,7 +300,7 @@ To enable HTTPS directly (without a reverse proxy), set `SWML_SSL_ENABLED` to "t
189
300
 
190
301
  The package includes comprehensive documentation in the `docs/` directory:
191
302
 
192
- - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents
303
+ - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents, including dynamic configuration
193
304
  - [Architecture](docs/architecture.md) - Overview of the SDK architecture and core concepts
194
305
  - [SWML Service Guide](docs/swml_service_guide.md) - Guide to the underlying SWML service
195
306
 
@@ -7,12 +7,54 @@ A Python SDK for creating, hosting, and securing SignalWire AI agents as microse
7
7
  - **Self-Contained Agents**: Each agent is both a web app and an AI persona
8
8
  - **Prompt Object Model**: Structured prompt composition using POM
9
9
  - **SWAIG Integration**: Easily define and handle AI tools/functions
10
+ - **Dynamic Configuration**: Configure agents per-request for multi-tenant apps and personalization
10
11
  - **Custom Routing**: Dynamic request handling for different paths and content
11
12
  - **SIP Integration**: Route SIP calls to agents based on SIP usernames
12
13
  - **Security Built-In**: Session management, function-specific security tokens, and basic auth
13
14
  - **State Management**: Persistent conversation state with automatic tracking
14
15
  - **Prefab Archetypes**: Ready-to-use agent types for common scenarios
15
16
  - **Multi-Agent Support**: Host multiple agents on a single server
17
+ - **Modular Skills System**: Add capabilities to agents with simple one-liner calls
18
+
19
+ ## Skills System
20
+
21
+ The SignalWire Agents SDK includes a powerful modular skills system that allows you to add complex capabilities to your agents with simple one-liner calls:
22
+
23
+ ```python
24
+ from signalwire_agents import AgentBase
25
+
26
+ # Create an agent
27
+ agent = AgentBase("My Assistant", route="/assistant")
28
+
29
+ # Add skills with one-liners
30
+ agent.add_skill("web_search") # Web search capability
31
+ agent.add_skill("datetime") # Current date/time info
32
+ agent.add_skill("math") # Mathematical calculations
33
+
34
+ # Configure skills with parameters
35
+ agent.add_skill("web_search", {
36
+ "num_results": 3, # Get 3 search results
37
+ "delay": 0.5 # Small delay between requests
38
+ })
39
+
40
+ agent.serve()
41
+ ```
42
+
43
+ ### Available Built-in Skills
44
+
45
+ - **web_search**: Google Custom Search API integration with web scraping
46
+ - **datetime**: Current date and time with timezone support
47
+ - **math**: Safe mathematical expression evaluation
48
+
49
+ ### Benefits
50
+
51
+ - **One-liner integration**: `agent.add_skill("skill_name")`
52
+ - **Configurable parameters**: `agent.add_skill("skill_name", {"param": "value"})`
53
+ - **Automatic discovery**: Skills are automatically found from the skills directory
54
+ - **Dependency validation**: Clear error messages for missing requirements
55
+ - **Modular architecture**: Skills are self-contained and reusable
56
+
57
+ For detailed documentation, see [Skills System README](docs/SKILLS_SYSTEM_README.md).
16
58
 
17
59
  ## Installation
18
60
 
@@ -137,6 +179,73 @@ Available prefabs include:
137
179
  - `FAQBotAgent`: Answers questions based on a knowledge base
138
180
  - `ConciergeAgent`: Routes users to specialized agents
139
181
  - `SurveyAgent`: Conducts structured surveys with questions and rating scales
182
+ - `ReceptionistAgent`: Greets callers and transfers them to appropriate departments
183
+
184
+ ## Dynamic Agent Configuration
185
+
186
+ Configure agents dynamically based on request parameters for multi-tenant applications, A/B testing, and personalization.
187
+
188
+ ### Static vs Dynamic Configuration
189
+
190
+ - **Static**: Agent configured once at startup (traditional approach)
191
+ - **Dynamic**: Agent configured fresh for each request based on parameters
192
+
193
+ ### Basic Example
194
+
195
+ ```python
196
+ from signalwire_agents import AgentBase
197
+
198
+ class DynamicAgent(AgentBase):
199
+ def __init__(self):
200
+ super().__init__(name="dynamic-agent", route="/dynamic")
201
+
202
+ # Set up dynamic configuration callback
203
+ self.set_dynamic_config_callback(self.configure_per_request)
204
+
205
+ def configure_per_request(self, query_params, body_params, headers, agent):
206
+ """Configure agent based on request parameters"""
207
+
208
+ # Extract parameters from request
209
+ tier = query_params.get('tier', 'standard')
210
+ language = query_params.get('language', 'en')
211
+ customer_id = query_params.get('customer_id')
212
+
213
+ # Configure voice and language
214
+ if language == 'es':
215
+ agent.add_language("Spanish", "es-ES", "rime.spore:mistv2")
216
+ else:
217
+ agent.add_language("English", "en-US", "rime.spore:mistv2")
218
+
219
+ # Configure based on service tier
220
+ if tier == 'premium':
221
+ agent.set_params({"end_of_speech_timeout": 300}) # Faster response
222
+ agent.prompt_add_section("Service Level", "You provide premium support.")
223
+ else:
224
+ agent.set_params({"end_of_speech_timeout": 500}) # Standard response
225
+ agent.prompt_add_section("Service Level", "You provide standard support.")
226
+
227
+ # Personalize with customer data
228
+ global_data = {"tier": tier, "language": language}
229
+ if customer_id:
230
+ global_data["customer_id"] = customer_id
231
+ agent.set_global_data(global_data)
232
+
233
+ # Usage examples:
234
+ # curl "http://localhost:3000/dynamic?tier=premium&language=es&customer_id=123"
235
+ # curl "http://localhost:3000/dynamic?tier=standard&language=en"
236
+ ```
237
+
238
+ ### Use Cases
239
+
240
+ - **Multi-tenant SaaS**: Different configurations per customer/organization
241
+ - **A/B Testing**: Test different agent behaviors with different user groups
242
+ - **Personalization**: Customize voice, prompts, and behavior per user
243
+ - **Localization**: Language and cultural adaptation based on user location
244
+ - **Dynamic Pricing**: Adjust features and capabilities based on subscription tiers
245
+
246
+ The `EphemeralAgentConfig` object provides all the same familiar methods as `AgentBase` (like `add_language()`, `prompt_add_section()`, `set_global_data()`) but applies them per-request instead of at startup.
247
+
248
+ For detailed documentation and advanced examples, see the [Agent Guide](docs/agent_guide.md#dynamic-agent-configuration).
140
249
 
141
250
  ## Configuration
142
251
 
@@ -161,7 +270,7 @@ To enable HTTPS directly (without a reverse proxy), set `SWML_SSL_ENABLED` to "t
161
270
 
162
271
  The package includes comprehensive documentation in the `docs/` directory:
163
272
 
164
- - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents
273
+ - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents, including dynamic configuration
165
274
  - [Architecture](docs/architecture.md) - Overview of the SDK architecture and core concepts
166
275
  - [SWML Service Guide](docs/swml_service_guide.md) - Guide to the underlying SWML service
167
276
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "signalwire_agents"
7
- version = "0.1.7"
7
+ version = "0.1.9"
8
8
  description = "SignalWire AI Agents SDK"
9
9
  authors = [
10
10
  {name = "SignalWire Team", email = "info@signalwire.com"}
@@ -31,13 +31,15 @@ dependencies = [
31
31
  "signalwire_pom==2.7.1",
32
32
  "structlog==25.3.0",
33
33
  "uvicorn==0.34.2",
34
+ "beautifulsoup4==4.12.3",
35
+ "pytz==2023.3",
34
36
  ]
35
37
 
36
38
  [project.urls]
37
39
  Homepage = "https://github.com/signalwire/signalwire-ai-agents"
38
40
 
39
41
  [tool.setuptools]
40
- packages = ["signalwire_agents", "signalwire_agents.prefabs", "signalwire_agents.utils", "signalwire_agents.core", "signalwire_agents.core.state", "signalwire_agents.core.security"]
42
+ packages = ["signalwire_agents", "signalwire_agents.prefabs", "signalwire_agents.utils", "signalwire_agents.core", "signalwire_agents.core.state", "signalwire_agents.core.security", "signalwire_agents.skills", "signalwire_agents.skills.web_search", "signalwire_agents.skills.datetime", "signalwire_agents.skills.math"]
41
43
  include-package-data = true
42
44
 
43
45
  [tool.setuptools.package-data]
@@ -14,7 +14,7 @@ SignalWire AI Agents SDK
14
14
  A package for building AI agents using SignalWire's AI and SWML capabilities.
15
15
  """
16
16
 
17
- __version__ = "0.1.7"
17
+ __version__ = "0.1.9"
18
18
 
19
19
  # Import core classes for easier access
20
20
  from signalwire_agents.core.agent_base import AgentBase
@@ -23,4 +23,7 @@ from signalwire_agents.core.swml_service import SWMLService
23
23
  from signalwire_agents.core.swml_builder import SWMLBuilder
24
24
  from signalwire_agents.core.state import StateManager, FileStateManager
25
25
 
26
+ # Import skills to trigger discovery
27
+ import signalwire_agents.skills
28
+
26
29
  __all__ = ["AgentBase", "AgentServer", "SWMLService", "SWMLBuilder", "StateManager", "FileStateManager"]