signalwire-agents 0.1.13__py3-none-any.whl → 1.0.17.dev4__py3-none-any.whl

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 (143) hide show
  1. signalwire_agents/__init__.py +99 -15
  2. signalwire_agents/agent_server.py +248 -60
  3. signalwire_agents/agents/bedrock.py +296 -0
  4. signalwire_agents/cli/__init__.py +9 -0
  5. signalwire_agents/cli/build_search.py +951 -41
  6. signalwire_agents/cli/config.py +80 -0
  7. signalwire_agents/cli/core/__init__.py +10 -0
  8. signalwire_agents/cli/core/agent_loader.py +470 -0
  9. signalwire_agents/cli/core/argparse_helpers.py +179 -0
  10. signalwire_agents/cli/core/dynamic_config.py +71 -0
  11. signalwire_agents/cli/core/service_loader.py +303 -0
  12. signalwire_agents/cli/dokku.py +2320 -0
  13. signalwire_agents/cli/execution/__init__.py +10 -0
  14. signalwire_agents/cli/execution/datamap_exec.py +446 -0
  15. signalwire_agents/cli/execution/webhook_exec.py +134 -0
  16. signalwire_agents/cli/init_project.py +2636 -0
  17. signalwire_agents/cli/output/__init__.py +10 -0
  18. signalwire_agents/cli/output/output_formatter.py +255 -0
  19. signalwire_agents/cli/output/swml_dump.py +186 -0
  20. signalwire_agents/cli/simulation/__init__.py +10 -0
  21. signalwire_agents/cli/simulation/data_generation.py +374 -0
  22. signalwire_agents/cli/simulation/data_overrides.py +200 -0
  23. signalwire_agents/cli/simulation/mock_env.py +282 -0
  24. signalwire_agents/cli/swaig_test_wrapper.py +52 -0
  25. signalwire_agents/cli/test_swaig.py +566 -2366
  26. signalwire_agents/cli/types.py +81 -0
  27. signalwire_agents/core/__init__.py +2 -2
  28. signalwire_agents/core/agent/__init__.py +12 -0
  29. signalwire_agents/core/agent/config/__init__.py +12 -0
  30. signalwire_agents/core/agent/deployment/__init__.py +9 -0
  31. signalwire_agents/core/agent/deployment/handlers/__init__.py +9 -0
  32. signalwire_agents/core/agent/prompt/__init__.py +14 -0
  33. signalwire_agents/core/agent/prompt/manager.py +306 -0
  34. signalwire_agents/core/agent/routing/__init__.py +9 -0
  35. signalwire_agents/core/agent/security/__init__.py +9 -0
  36. signalwire_agents/core/agent/swml/__init__.py +9 -0
  37. signalwire_agents/core/agent/tools/__init__.py +15 -0
  38. signalwire_agents/core/agent/tools/decorator.py +97 -0
  39. signalwire_agents/core/agent/tools/registry.py +210 -0
  40. signalwire_agents/core/agent_base.py +845 -2916
  41. signalwire_agents/core/auth_handler.py +233 -0
  42. signalwire_agents/core/config_loader.py +259 -0
  43. signalwire_agents/core/contexts.py +418 -0
  44. signalwire_agents/core/data_map.py +3 -15
  45. signalwire_agents/core/function_result.py +116 -44
  46. signalwire_agents/core/logging_config.py +162 -18
  47. signalwire_agents/core/mixins/__init__.py +28 -0
  48. signalwire_agents/core/mixins/ai_config_mixin.py +442 -0
  49. signalwire_agents/core/mixins/auth_mixin.py +280 -0
  50. signalwire_agents/core/mixins/prompt_mixin.py +358 -0
  51. signalwire_agents/core/mixins/serverless_mixin.py +460 -0
  52. signalwire_agents/core/mixins/skill_mixin.py +55 -0
  53. signalwire_agents/core/mixins/state_mixin.py +153 -0
  54. signalwire_agents/core/mixins/tool_mixin.py +230 -0
  55. signalwire_agents/core/mixins/web_mixin.py +1142 -0
  56. signalwire_agents/core/security_config.py +333 -0
  57. signalwire_agents/core/skill_base.py +84 -1
  58. signalwire_agents/core/skill_manager.py +62 -20
  59. signalwire_agents/core/swaig_function.py +18 -5
  60. signalwire_agents/core/swml_builder.py +207 -11
  61. signalwire_agents/core/swml_handler.py +27 -21
  62. signalwire_agents/core/swml_renderer.py +123 -312
  63. signalwire_agents/core/swml_service.py +171 -203
  64. signalwire_agents/mcp_gateway/__init__.py +29 -0
  65. signalwire_agents/mcp_gateway/gateway_service.py +564 -0
  66. signalwire_agents/mcp_gateway/mcp_manager.py +513 -0
  67. signalwire_agents/mcp_gateway/session_manager.py +218 -0
  68. signalwire_agents/prefabs/concierge.py +0 -3
  69. signalwire_agents/prefabs/faq_bot.py +0 -3
  70. signalwire_agents/prefabs/info_gatherer.py +0 -3
  71. signalwire_agents/prefabs/receptionist.py +0 -3
  72. signalwire_agents/prefabs/survey.py +0 -3
  73. signalwire_agents/schema.json +9218 -5489
  74. signalwire_agents/search/__init__.py +7 -1
  75. signalwire_agents/search/document_processor.py +490 -31
  76. signalwire_agents/search/index_builder.py +307 -37
  77. signalwire_agents/search/migration.py +418 -0
  78. signalwire_agents/search/models.py +30 -0
  79. signalwire_agents/search/pgvector_backend.py +748 -0
  80. signalwire_agents/search/query_processor.py +162 -31
  81. signalwire_agents/search/search_engine.py +916 -35
  82. signalwire_agents/search/search_service.py +376 -53
  83. signalwire_agents/skills/README.md +452 -0
  84. signalwire_agents/skills/__init__.py +14 -2
  85. signalwire_agents/skills/api_ninjas_trivia/README.md +215 -0
  86. signalwire_agents/skills/api_ninjas_trivia/__init__.py +12 -0
  87. signalwire_agents/skills/api_ninjas_trivia/skill.py +237 -0
  88. signalwire_agents/skills/datasphere/README.md +210 -0
  89. signalwire_agents/skills/datasphere/skill.py +84 -3
  90. signalwire_agents/skills/datasphere_serverless/README.md +258 -0
  91. signalwire_agents/skills/datasphere_serverless/__init__.py +9 -0
  92. signalwire_agents/skills/datasphere_serverless/skill.py +82 -1
  93. signalwire_agents/skills/datetime/README.md +132 -0
  94. signalwire_agents/skills/datetime/__init__.py +9 -0
  95. signalwire_agents/skills/datetime/skill.py +20 -7
  96. signalwire_agents/skills/joke/README.md +149 -0
  97. signalwire_agents/skills/joke/__init__.py +9 -0
  98. signalwire_agents/skills/joke/skill.py +21 -0
  99. signalwire_agents/skills/math/README.md +161 -0
  100. signalwire_agents/skills/math/__init__.py +9 -0
  101. signalwire_agents/skills/math/skill.py +18 -4
  102. signalwire_agents/skills/mcp_gateway/README.md +230 -0
  103. signalwire_agents/skills/mcp_gateway/__init__.py +10 -0
  104. signalwire_agents/skills/mcp_gateway/skill.py +421 -0
  105. signalwire_agents/skills/native_vector_search/README.md +210 -0
  106. signalwire_agents/skills/native_vector_search/__init__.py +9 -0
  107. signalwire_agents/skills/native_vector_search/skill.py +569 -101
  108. signalwire_agents/skills/play_background_file/README.md +218 -0
  109. signalwire_agents/skills/play_background_file/__init__.py +12 -0
  110. signalwire_agents/skills/play_background_file/skill.py +242 -0
  111. signalwire_agents/skills/registry.py +395 -40
  112. signalwire_agents/skills/spider/README.md +236 -0
  113. signalwire_agents/skills/spider/__init__.py +13 -0
  114. signalwire_agents/skills/spider/skill.py +598 -0
  115. signalwire_agents/skills/swml_transfer/README.md +395 -0
  116. signalwire_agents/skills/swml_transfer/__init__.py +10 -0
  117. signalwire_agents/skills/swml_transfer/skill.py +359 -0
  118. signalwire_agents/skills/weather_api/README.md +178 -0
  119. signalwire_agents/skills/weather_api/__init__.py +12 -0
  120. signalwire_agents/skills/weather_api/skill.py +191 -0
  121. signalwire_agents/skills/web_search/README.md +163 -0
  122. signalwire_agents/skills/web_search/__init__.py +9 -0
  123. signalwire_agents/skills/web_search/skill.py +586 -112
  124. signalwire_agents/skills/wikipedia_search/README.md +228 -0
  125. signalwire_agents/{core/state → skills/wikipedia_search}/__init__.py +5 -4
  126. signalwire_agents/skills/{wikipedia → wikipedia_search}/skill.py +33 -3
  127. signalwire_agents/web/__init__.py +17 -0
  128. signalwire_agents/web/web_service.py +559 -0
  129. signalwire_agents-1.0.17.dev4.data/data/share/man/man1/sw-agent-init.1 +400 -0
  130. signalwire_agents-1.0.17.dev4.data/data/share/man/man1/sw-search.1 +483 -0
  131. signalwire_agents-1.0.17.dev4.data/data/share/man/man1/swaig-test.1 +308 -0
  132. {signalwire_agents-0.1.13.dist-info → signalwire_agents-1.0.17.dev4.dist-info}/METADATA +347 -215
  133. signalwire_agents-1.0.17.dev4.dist-info/RECORD +147 -0
  134. signalwire_agents-1.0.17.dev4.dist-info/entry_points.txt +6 -0
  135. signalwire_agents/core/state/file_state_manager.py +0 -219
  136. signalwire_agents/core/state/state_manager.py +0 -101
  137. signalwire_agents/skills/wikipedia/__init__.py +0 -9
  138. signalwire_agents-0.1.13.data/data/schema.json +0 -5611
  139. signalwire_agents-0.1.13.dist-info/RECORD +0 -67
  140. signalwire_agents-0.1.13.dist-info/entry_points.txt +0 -3
  141. {signalwire_agents-0.1.13.dist-info → signalwire_agents-1.0.17.dev4.dist-info}/WHEEL +0 -0
  142. {signalwire_agents-0.1.13.dist-info → signalwire_agents-1.0.17.dev4.dist-info}/licenses/LICENSE +0 -0
  143. {signalwire_agents-0.1.13.dist-info → signalwire_agents-1.0.17.dev4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,308 @@
1
+ .\" Man page for swaig-test
2
+ .\" Copyright (c) 2025 SignalWire
3
+ .\" Licensed under the MIT License
4
+ .TH SWAIG-TEST 1 "November 2025" "SignalWire Agents SDK 1.0.6" "SignalWire Commands"
5
+ .SH NAME
6
+ swaig-test \- test SWAIG functions and generate SWML documents for SignalWire AI agents
7
+ .SH SYNOPSIS
8
+ .B swaig-test
9
+ .I agent_path
10
+ .RI [ options ]
11
+ .br
12
+ .B swaig-test
13
+ .I agent_path
14
+ .B \-\-exec
15
+ .I function_name
16
+ .RI [ function_arguments ]
17
+ .br
18
+ .B swaig-test
19
+ .I agent_path
20
+ .B \-\-dump\-swml
21
+ .RI [ options ]
22
+ .SH DESCRIPTION
23
+ .B swaig-test
24
+ is a command-line tool for testing SignalWire AI Agent Interface (SWAIG) functions
25
+ and generating SWML (SignalWire Markup Language) documents. It allows developers to
26
+ test their agents locally without deploying to a server, simulate various call
27
+ scenarios, and verify function behavior.
28
+ .PP
29
+ The tool loads a Python file containing one or more SignalWire agents, discovers
30
+ the available SWAIG functions, and allows interactive testing with simulated
31
+ call data. It supports both webhook-based functions and DataMap functions.
32
+ .SH ARGUMENTS
33
+ .TP
34
+ .I agent_path
35
+ Path to the Python file containing the SignalWire agent definition.
36
+ This file should contain a class inheriting from AgentBase or an
37
+ instantiated agent object.
38
+ .SH OPTIONS
39
+ .SS "Common Options"
40
+ .TP
41
+ .BR \-h ", " \-\-help
42
+ Display help message and exit.
43
+ .TP
44
+ .BR \-v ", " \-\-verbose
45
+ Enable verbose output. Shows detailed information about function
46
+ execution, post data, and results.
47
+ .TP
48
+ .B \-\-raw
49
+ Output raw JSON only, suitable for piping to tools like
50
+ .BR jq (1).
51
+ Suppresses all decorative output and logging.
52
+ .TP
53
+ .BI \-\-agent\-class " CLASS"
54
+ Specify which agent class to use when the file contains multiple
55
+ agent definitions. Required if the file has more than one agent.
56
+ .TP
57
+ .BI \-\-route " ROUTE"
58
+ Specify service by route (e.g., /healthcare, /finance). Alternative
59
+ to \-\-agent\-class for selecting agents.
60
+ .SS "Actions (choose one)"
61
+ .TP
62
+ .B \-\-list\-agents
63
+ List all agents found in the specified file, showing their class
64
+ names, types (class or instance), routes, and descriptions.
65
+ .TP
66
+ .B \-\-list\-tools
67
+ List all SWAIG tools (functions) available in the agent, including
68
+ their names, descriptions, and parameter schemas.
69
+ .TP
70
+ .B \-\-dump\-swml
71
+ Generate and output the complete SWML document that would be
72
+ returned by the agent. Useful for debugging agent configuration.
73
+ .TP
74
+ .BI \-\-exec " FUNCTION"
75
+ Execute the specified function with arguments provided after the
76
+ function name. All options must appear BEFORE \-\-exec.
77
+ .SS "Function Execution Options"
78
+ .TP
79
+ .BI \-\-custom\-data " JSON"
80
+ JSON string with custom post_data overrides for function execution.
81
+ .TP
82
+ .B \-\-minimal
83
+ Use minimal post_data for function execution. Only includes
84
+ essential fields required for the function call.
85
+ .TP
86
+ .B \-\-fake\-full\-data
87
+ Use comprehensive fake post_data including simulated call
88
+ metadata, SIP headers, and user variables.
89
+ .SS "SWML Generation Options"
90
+ .TP
91
+ .BI \-\-call\-type " TYPE"
92
+ Set the call type for SWML generation. Valid values are
93
+ .B sip
94
+ or
95
+ .BR webrtc .
96
+ Default is webrtc.
97
+ .TP
98
+ .BI \-\-call\-direction " DIR"
99
+ Set the call direction. Valid values are
100
+ .B inbound
101
+ or
102
+ .BR outbound .
103
+ Default is inbound.
104
+ .TP
105
+ .BI \-\-call\-state " STATE"
106
+ Set the call state. Default is "created".
107
+ .TP
108
+ .BI \-\-from\-number " NUMBER"
109
+ Override the "from" phone number in the simulated call data.
110
+ .TP
111
+ .BI \-\-to\-extension " EXT"
112
+ Override the "to" extension in the simulated call data.
113
+ .SS "Data Customization"
114
+ .TP
115
+ .BI \-\-user\-vars " JSON"
116
+ JSON string for userVariables to include in the request.
117
+ .TP
118
+ .BI \-\-query\-params " JSON"
119
+ JSON string for query parameters to include in the request.
120
+ .TP
121
+ .BI \-\-override " KEY=VALUE"
122
+ Override a specific value in the post data using dot notation.
123
+ Can be specified multiple times.
124
+ Example: \-\-override call.state=answered
125
+ .TP
126
+ .BI \-\-header " KEY=VALUE"
127
+ Add an HTTP header to the simulated request.
128
+ Can be specified multiple times.
129
+ Example: \-\-header Authorization="Bearer token"
130
+ .SS "Serverless Simulation"
131
+ .TP
132
+ .BI \-\-simulate\-serverless " PLATFORM"
133
+ Simulate a serverless platform environment. Valid platforms are:
134
+ .RS
135
+ .IP \(bu 2
136
+ .B lambda
137
+ \- AWS Lambda
138
+ .IP \(bu 2
139
+ .B cgi
140
+ \- CGI environment
141
+ .IP \(bu 2
142
+ .B cloud_function
143
+ \- Google Cloud Functions
144
+ .IP \(bu 2
145
+ .B azure_function
146
+ \- Azure Functions
147
+ .RE
148
+ .TP
149
+ .BI \-\-env " KEY=VALUE"
150
+ Set an environment variable for the simulation.
151
+ Can be specified multiple times.
152
+ .TP
153
+ .BI \-\-env\-file " FILE"
154
+ Load environment variables from a file.
155
+ .TP
156
+ .B \-\-help\-platforms
157
+ Show detailed help for platform-specific serverless options.
158
+ .TP
159
+ .B \-\-help\-examples
160
+ Show comprehensive usage examples.
161
+ .SS "Platform-Specific Options"
162
+ These options are used with \-\-simulate\-serverless. Use \-\-help\-platforms
163
+ for complete documentation.
164
+ .TP
165
+ .BI \-\-aws\-function\-name " NAME"
166
+ AWS Lambda function name.
167
+ .TP
168
+ .BI \-\-aws\-region " REGION"
169
+ AWS region.
170
+ .TP
171
+ .BI \-\-cgi\-host " HOST"
172
+ CGI server hostname (required for CGI simulation).
173
+ .TP
174
+ .B \-\-cgi\-https
175
+ Use HTTPS for CGI URLs.
176
+ .TP
177
+ .BI \-\-gcp\-project " ID"
178
+ Google Cloud project ID.
179
+ .TP
180
+ .BI \-\-azure\-env " ENV"
181
+ Azure Functions environment.
182
+ .SH EXAMPLES
183
+ .SS Basic Usage
184
+ List all tools in an agent:
185
+ .PP
186
+ .RS
187
+ .nf
188
+ swaig-test agent.py
189
+ swaig-test agent.py --list-tools
190
+ .fi
191
+ .RE
192
+ .SS Executing Functions
193
+ Execute a function with arguments:
194
+ .PP
195
+ .RS
196
+ .nf
197
+ swaig-test agent.py --exec search --query "AI" --limit 5
198
+ swaig-test agent.py --verbose --exec get_info --topic "weather"
199
+ .fi
200
+ .RE
201
+ .PP
202
+ .B Important:
203
+ All options (like \-\-verbose, \-\-call\-id) must come BEFORE \-\-exec.
204
+ Everything after \-\-exec function_name is treated as function arguments.
205
+ .PP
206
+ Correct:
207
+ .RS
208
+ .nf
209
+ swaig-test agent.py --call-id my-session --exec add_todo --text "Buy milk"
210
+ .fi
211
+ .RE
212
+ .PP
213
+ Incorrect (won't work):
214
+ .RS
215
+ .nf
216
+ swaig-test agent.py --exec add_todo --text "Buy milk" --call-id my-session
217
+ .fi
218
+ .RE
219
+ .SS SWML Generation
220
+ Generate SWML document:
221
+ .PP
222
+ .RS
223
+ .nf
224
+ swaig-test agent.py --dump-swml
225
+ swaig-test agent.py --dump-swml --raw | jq '.'
226
+ swaig-test agent.py --dump-swml --call-type sip --from-number +15551234567
227
+ .fi
228
+ .RE
229
+ .PP
230
+ Extract specific fields:
231
+ .PP
232
+ .RS
233
+ .nf
234
+ swaig-test agent.py --dump-swml --raw | jq '.sections.main[1].ai.SWAIG.functions'
235
+ .fi
236
+ .RE
237
+ .SS Multi-Agent Files
238
+ When a file contains multiple agents:
239
+ .PP
240
+ .RS
241
+ .nf
242
+ swaig-test multi_agent.py --list-agents
243
+ swaig-test multi_agent.py --agent-class MattiAgent --list-tools
244
+ swaig-test multi_agent.py --route /healthcare --exec schedule_appointment
245
+ .fi
246
+ .RE
247
+ .SS Serverless Simulation
248
+ Test with AWS Lambda simulation:
249
+ .PP
250
+ .RS
251
+ .nf
252
+ swaig-test agent.py --simulate-serverless lambda --dump-swml
253
+ swaig-test agent.py --simulate-serverless lambda \\
254
+ --env API_KEY=secret \\
255
+ --exec my_function
256
+ .fi
257
+ .RE
258
+ .PP
259
+ Test with CGI simulation:
260
+ .PP
261
+ .RS
262
+ .nf
263
+ swaig-test agent.py --simulate-serverless cgi \\
264
+ --cgi-host example.com \\
265
+ --cgi-https \\
266
+ --dump-swml
267
+ .fi
268
+ .RE
269
+ .SS Dynamic Configuration
270
+ Test agents with dynamic configuration:
271
+ .PP
272
+ .RS
273
+ .nf
274
+ swaig-test agent.py --dump-swml \\
275
+ --query-params '{"tier":"premium"}' \\
276
+ --header "Authorization=Bearer token" \\
277
+ --user-vars '{"language":"es"}'
278
+ .fi
279
+ .RE
280
+ .SH EXIT STATUS
281
+ .TP
282
+ .B 0
283
+ Successful execution.
284
+ .TP
285
+ .B 1
286
+ An error occurred. Check stderr for details.
287
+ .SH ENVIRONMENT
288
+ .TP
289
+ .B SIGNALWIRE_LOG_MODE
290
+ Controls logging verbosity. Set to "off" to suppress logs.
291
+ Automatically set to "off" when using \-\-raw or \-\-dump\-swml.
292
+ .SH FILES
293
+ .TP
294
+ .I agent.py
295
+ A Python file containing one or more SignalWire agent definitions.
296
+ The file should import from signalwire_agents and define classes
297
+ inheriting from AgentBase.
298
+ .SH SEE ALSO
299
+ .BR sw-agent-init (1),
300
+ .BR sw-search (1),
301
+ .BR jq (1)
302
+ .PP
303
+ SignalWire AI Agents SDK documentation:
304
+ .I https://github.com/signalwire/signalwire-agents
305
+ .SH AUTHORS
306
+ SignalWire Team <info@signalwire.com>
307
+ .SH COPYRIGHT
308
+ Copyright (c) 2025 SignalWire. Licensed under the MIT License.