signalwire-agents 0.1.6__tar.gz → 0.1.8__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 (42) hide show
  1. {signalwire_agents-0.1.6/signalwire_agents.egg-info → signalwire_agents-0.1.8}/PKG-INFO +71 -2
  2. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/README.md +70 -1
  3. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/pyproject.toml +1 -1
  4. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/__init__.py +1 -1
  5. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/agent_base.py +1507 -1270
  6. signalwire_agents-0.1.8/signalwire_agents/core/function_result.py +1153 -0
  7. signalwire_agents-0.1.8/signalwire_agents/core/security/session_manager.py +267 -0
  8. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/swml_builder.py +5 -1
  9. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/swml_service.py +90 -49
  10. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/prefabs/concierge.py +9 -2
  11. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/prefabs/faq_bot.py +3 -0
  12. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/prefabs/info_gatherer.py +152 -33
  13. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/prefabs/receptionist.py +17 -22
  14. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/prefabs/survey.py +9 -2
  15. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8/signalwire_agents.egg-info}/PKG-INFO +71 -2
  16. signalwire_agents-0.1.6/signalwire_agents/core/function_result.py +0 -123
  17. signalwire_agents-0.1.6/signalwire_agents/core/security/session_manager.py +0 -179
  18. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/LICENSE +0 -0
  19. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/schema.json +0 -0
  20. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/setup.cfg +0 -0
  21. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/setup.py +0 -0
  22. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/agent_server.py +0 -0
  23. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/__init__.py +0 -0
  24. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/pom_builder.py +0 -0
  25. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/security/__init__.py +0 -0
  26. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/state/__init__.py +0 -0
  27. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/state/file_state_manager.py +0 -0
  28. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/state/state_manager.py +0 -0
  29. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/swaig_function.py +0 -0
  30. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/swml_handler.py +0 -0
  31. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/core/swml_renderer.py +0 -0
  32. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/prefabs/__init__.py +0 -0
  33. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/schema.json +0 -0
  34. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/utils/__init__.py +0 -0
  35. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/utils/pom_utils.py +0 -0
  36. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/utils/schema_utils.py +0 -0
  37. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/utils/token_generators.py +0 -0
  38. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents/utils/validators.py +0 -0
  39. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents.egg-info/SOURCES.txt +0 -0
  40. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents.egg-info/dependency_links.txt +0 -0
  41. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/signalwire_agents.egg-info/requires.txt +0 -0
  42. {signalwire_agents-0.1.6 → signalwire_agents-0.1.8}/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.6
3
+ Version: 0.1.8
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
@@ -35,7 +35,9 @@ A Python SDK for creating, hosting, and securing SignalWire AI agents as microse
35
35
  - **Self-Contained Agents**: Each agent is both a web app and an AI persona
36
36
  - **Prompt Object Model**: Structured prompt composition using POM
37
37
  - **SWAIG Integration**: Easily define and handle AI tools/functions
38
+ - **Dynamic Configuration**: Configure agents per-request for multi-tenant apps and personalization
38
39
  - **Custom Routing**: Dynamic request handling for different paths and content
40
+ - **SIP Integration**: Route SIP calls to agents based on SIP usernames
39
41
  - **Security Built-In**: Session management, function-specific security tokens, and basic auth
40
42
  - **State Management**: Persistent conversation state with automatic tracking
41
43
  - **Prefab Archetypes**: Ready-to-use agent types for common scenarios
@@ -164,6 +166,73 @@ Available prefabs include:
164
166
  - `FAQBotAgent`: Answers questions based on a knowledge base
165
167
  - `ConciergeAgent`: Routes users to specialized agents
166
168
  - `SurveyAgent`: Conducts structured surveys with questions and rating scales
169
+ - `ReceptionistAgent`: Greets callers and transfers them to appropriate departments
170
+
171
+ ## Dynamic Agent Configuration
172
+
173
+ Configure agents dynamically based on request parameters for multi-tenant applications, A/B testing, and personalization.
174
+
175
+ ### Static vs Dynamic Configuration
176
+
177
+ - **Static**: Agent configured once at startup (traditional approach)
178
+ - **Dynamic**: Agent configured fresh for each request based on parameters
179
+
180
+ ### Basic Example
181
+
182
+ ```python
183
+ from signalwire_agents import AgentBase
184
+
185
+ class DynamicAgent(AgentBase):
186
+ def __init__(self):
187
+ super().__init__(name="dynamic-agent", route="/dynamic")
188
+
189
+ # Set up dynamic configuration callback
190
+ self.set_dynamic_config_callback(self.configure_per_request)
191
+
192
+ def configure_per_request(self, query_params, body_params, headers, agent):
193
+ """Configure agent based on request parameters"""
194
+
195
+ # Extract parameters from request
196
+ tier = query_params.get('tier', 'standard')
197
+ language = query_params.get('language', 'en')
198
+ customer_id = query_params.get('customer_id')
199
+
200
+ # Configure voice and language
201
+ if language == 'es':
202
+ agent.add_language("Spanish", "es-ES", "rime.spore:mistv2")
203
+ else:
204
+ agent.add_language("English", "en-US", "rime.spore:mistv2")
205
+
206
+ # Configure based on service tier
207
+ if tier == 'premium':
208
+ agent.set_params({"end_of_speech_timeout": 300}) # Faster response
209
+ agent.prompt_add_section("Service Level", "You provide premium support.")
210
+ else:
211
+ agent.set_params({"end_of_speech_timeout": 500}) # Standard response
212
+ agent.prompt_add_section("Service Level", "You provide standard support.")
213
+
214
+ # Personalize with customer data
215
+ global_data = {"tier": tier, "language": language}
216
+ if customer_id:
217
+ global_data["customer_id"] = customer_id
218
+ agent.set_global_data(global_data)
219
+
220
+ # Usage examples:
221
+ # curl "http://localhost:3000/dynamic?tier=premium&language=es&customer_id=123"
222
+ # curl "http://localhost:3000/dynamic?tier=standard&language=en"
223
+ ```
224
+
225
+ ### Use Cases
226
+
227
+ - **Multi-tenant SaaS**: Different configurations per customer/organization
228
+ - **A/B Testing**: Test different agent behaviors with different user groups
229
+ - **Personalization**: Customize voice, prompts, and behavior per user
230
+ - **Localization**: Language and cultural adaptation based on user location
231
+ - **Dynamic Pricing**: Adjust features and capabilities based on subscription tiers
232
+
233
+ 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.
234
+
235
+ For detailed documentation and advanced examples, see the [Agent Guide](docs/agent_guide.md#dynamic-agent-configuration).
167
236
 
168
237
  ## Configuration
169
238
 
@@ -188,7 +257,7 @@ To enable HTTPS directly (without a reverse proxy), set `SWML_SSL_ENABLED` to "t
188
257
 
189
258
  The package includes comprehensive documentation in the `docs/` directory:
190
259
 
191
- - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents
260
+ - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents, including dynamic configuration
192
261
  - [Architecture](docs/architecture.md) - Overview of the SDK architecture and core concepts
193
262
  - [SWML Service Guide](docs/swml_service_guide.md) - Guide to the underlying SWML service
194
263
 
@@ -7,7 +7,9 @@ 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
12
+ - **SIP Integration**: Route SIP calls to agents based on SIP usernames
11
13
  - **Security Built-In**: Session management, function-specific security tokens, and basic auth
12
14
  - **State Management**: Persistent conversation state with automatic tracking
13
15
  - **Prefab Archetypes**: Ready-to-use agent types for common scenarios
@@ -136,6 +138,73 @@ Available prefabs include:
136
138
  - `FAQBotAgent`: Answers questions based on a knowledge base
137
139
  - `ConciergeAgent`: Routes users to specialized agents
138
140
  - `SurveyAgent`: Conducts structured surveys with questions and rating scales
141
+ - `ReceptionistAgent`: Greets callers and transfers them to appropriate departments
142
+
143
+ ## Dynamic Agent Configuration
144
+
145
+ Configure agents dynamically based on request parameters for multi-tenant applications, A/B testing, and personalization.
146
+
147
+ ### Static vs Dynamic Configuration
148
+
149
+ - **Static**: Agent configured once at startup (traditional approach)
150
+ - **Dynamic**: Agent configured fresh for each request based on parameters
151
+
152
+ ### Basic Example
153
+
154
+ ```python
155
+ from signalwire_agents import AgentBase
156
+
157
+ class DynamicAgent(AgentBase):
158
+ def __init__(self):
159
+ super().__init__(name="dynamic-agent", route="/dynamic")
160
+
161
+ # Set up dynamic configuration callback
162
+ self.set_dynamic_config_callback(self.configure_per_request)
163
+
164
+ def configure_per_request(self, query_params, body_params, headers, agent):
165
+ """Configure agent based on request parameters"""
166
+
167
+ # Extract parameters from request
168
+ tier = query_params.get('tier', 'standard')
169
+ language = query_params.get('language', 'en')
170
+ customer_id = query_params.get('customer_id')
171
+
172
+ # Configure voice and language
173
+ if language == 'es':
174
+ agent.add_language("Spanish", "es-ES", "rime.spore:mistv2")
175
+ else:
176
+ agent.add_language("English", "en-US", "rime.spore:mistv2")
177
+
178
+ # Configure based on service tier
179
+ if tier == 'premium':
180
+ agent.set_params({"end_of_speech_timeout": 300}) # Faster response
181
+ agent.prompt_add_section("Service Level", "You provide premium support.")
182
+ else:
183
+ agent.set_params({"end_of_speech_timeout": 500}) # Standard response
184
+ agent.prompt_add_section("Service Level", "You provide standard support.")
185
+
186
+ # Personalize with customer data
187
+ global_data = {"tier": tier, "language": language}
188
+ if customer_id:
189
+ global_data["customer_id"] = customer_id
190
+ agent.set_global_data(global_data)
191
+
192
+ # Usage examples:
193
+ # curl "http://localhost:3000/dynamic?tier=premium&language=es&customer_id=123"
194
+ # curl "http://localhost:3000/dynamic?tier=standard&language=en"
195
+ ```
196
+
197
+ ### Use Cases
198
+
199
+ - **Multi-tenant SaaS**: Different configurations per customer/organization
200
+ - **A/B Testing**: Test different agent behaviors with different user groups
201
+ - **Personalization**: Customize voice, prompts, and behavior per user
202
+ - **Localization**: Language and cultural adaptation based on user location
203
+ - **Dynamic Pricing**: Adjust features and capabilities based on subscription tiers
204
+
205
+ 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.
206
+
207
+ For detailed documentation and advanced examples, see the [Agent Guide](docs/agent_guide.md#dynamic-agent-configuration).
139
208
 
140
209
  ## Configuration
141
210
 
@@ -160,7 +229,7 @@ To enable HTTPS directly (without a reverse proxy), set `SWML_SSL_ENABLED` to "t
160
229
 
161
230
  The package includes comprehensive documentation in the `docs/` directory:
162
231
 
163
- - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents
232
+ - [Agent Guide](docs/agent_guide.md) - Detailed guide to creating and customizing agents, including dynamic configuration
164
233
  - [Architecture](docs/architecture.md) - Overview of the SDK architecture and core concepts
165
234
  - [SWML Service Guide](docs/swml_service_guide.md) - Guide to the underlying SWML service
166
235
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "signalwire_agents"
7
- version = "0.1.6"
7
+ version = "0.1.8"
8
8
  description = "SignalWire AI Agents SDK"
9
9
  authors = [
10
10
  {name = "SignalWire Team", email = "info@signalwire.com"}
@@ -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.6"
17
+ __version__ = "0.1.8"
18
18
 
19
19
  # Import core classes for easier access
20
20
  from signalwire_agents.core.agent_base import AgentBase