signalwire-sdk 3.0.0__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.
- signalwire_sdk-3.0.0/LICENSE +21 -0
- signalwire_sdk-3.0.0/PKG-INFO +358 -0
- signalwire_sdk-3.0.0/README.md +262 -0
- signalwire_sdk-3.0.0/man/sw-agent-init.1 +400 -0
- signalwire_sdk-3.0.0/man/sw-search.1 +483 -0
- signalwire_sdk-3.0.0/man/swaig-test.1 +308 -0
- signalwire_sdk-3.0.0/pyproject.toml +161 -0
- signalwire_sdk-3.0.0/setup.cfg +4 -0
- signalwire_sdk-3.0.0/setup.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/__init__.py +159 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/agent_server.py +840 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/agents/bedrock.py +296 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/__init__.py +18 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/build_search.py +1388 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/config.py +80 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/core/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/core/agent_loader.py +470 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/core/argparse_helpers.py +179 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/core/dynamic_config.py +71 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/core/service_loader.py +303 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/dokku.py +2299 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/execution/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/execution/datamap_exec.py +451 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/execution/webhook_exec.py +134 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/init_project.py +2636 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/output/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/output/output_formatter.py +255 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/output/swml_dump.py +186 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/simulation/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/simulation/data_generation.py +374 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/simulation/data_overrides.py +200 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/simulation/mock_env.py +282 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/swaig_test_wrapper.py +52 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/test_swaig.py +809 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/cli/types.py +81 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/__init__.py +29 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/__init__.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/config/__init__.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/deployment/__init__.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/deployment/handlers/__init__.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/prompt/__init__.py +14 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/prompt/manager.py +307 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/routing/__init__.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/security/__init__.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/swml/__init__.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/tools/__init__.py +16 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/tools/decorator.py +182 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/tools/registry.py +239 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent/tools/type_inference.py +274 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/agent_base.py +1436 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/auth_handler.py +233 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/config_loader.py +263 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/contexts.py +1360 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/data_map.py +520 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/function_result.py +1544 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/logging_config.py +296 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/__init__.py +28 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/ai_config_mixin.py +603 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/auth_mixin.py +279 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/mcp_server_mixin.py +157 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/prompt_mixin.py +381 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/serverless_mixin.py +482 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/skill_mixin.py +55 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/state_mixin.py +153 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/tool_mixin.py +350 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/mixins/web_mixin.py +1440 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/pom_builder.py +198 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/security/__init__.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/security/session_manager.py +273 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/security_config.py +364 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/skill_base.py +266 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/skill_manager.py +244 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/swaig_function.py +274 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/swml_builder.py +414 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/swml_handler.py +257 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/swml_renderer.py +194 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/core/swml_service.py +1201 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/livewire/__init__.py +885 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/livewire/plugins.py +124 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/mcp_gateway/__init__.py +29 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/mcp_gateway/gateway_service.py +570 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/mcp_gateway/mcp_manager.py +530 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/mcp_gateway/session_manager.py +223 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/pom/__init__.py +22 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/pom/pom.py +540 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/pom/pom_tool.py +120 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/prefabs/__init__.py +26 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/prefabs/concierge.py +271 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/prefabs/faq_bot.py +305 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/prefabs/info_gatherer.py +383 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/prefabs/receptionist.py +287 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/prefabs/survey.py +374 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/relay/__init__.py +177 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/relay/call.py +1317 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/relay/client.py +1112 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/relay/constants.py +120 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/relay/event.py +638 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/relay/message.py +127 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/__init__.py +17 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/_base.py +113 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/_pagination.py +62 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/client.py +113 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/__init__.py +8 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/addresses.py +33 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/calling.py +154 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/chat.py +24 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/compat.py +270 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/datasphere.py +40 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/fabric.py +177 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/imported_numbers.py +24 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/logs.py +64 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/lookup.py +24 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/mfa.py +30 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/number_groups.py +41 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/phone_numbers.py +26 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/project.py +37 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/pubsub.py +24 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/queues.py +32 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/recordings.py +30 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/registry.py +77 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/short_codes.py +30 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/sip_profile.py +27 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/verified_callers.py +29 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/rest/namespaces/video.py +123 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/schema.json +12250 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/__init__.py +137 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/document_processor.py +1239 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/index_builder.py +804 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/migration.py +419 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/models.py +30 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/pgvector_backend.py +777 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/query_processor.py +513 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/search_engine.py +1282 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/search/search_service.py +587 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/README.md +452 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/__init__.py +26 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/api_ninjas_trivia/README.md +215 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/api_ninjas_trivia/__init__.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/api_ninjas_trivia/skill.py +237 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/claude_skills/README.md +455 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/claude_skills/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/claude_skills/skill.py +758 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datasphere/README.md +210 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datasphere/__init__.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datasphere/skill.py +315 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datasphere_serverless/README.md +258 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datasphere_serverless/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datasphere_serverless/skill.py +238 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datetime/README.md +132 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datetime/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/datetime/skill.py +126 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/google_maps/__init__.py +1 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/google_maps/skill.py +547 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/info_gatherer/README.md +69 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/info_gatherer/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/info_gatherer/skill.py +311 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/joke/README.md +149 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/joke/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/joke/skill.py +109 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/math/README.md +161 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/math/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/math/skill.py +144 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/mcp_gateway/README.md +230 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/mcp_gateway/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/mcp_gateway/skill.py +430 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/native_vector_search/README.md +210 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/native_vector_search/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/native_vector_search/skill.py +826 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/play_background_file/README.md +218 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/play_background_file/__init__.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/play_background_file/skill.py +242 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/registry.py +481 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/spider/README.md +236 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/spider/__init__.py +13 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/spider/skill.py +626 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/swml_transfer/README.md +395 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/swml_transfer/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/swml_transfer/skill.py +359 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/weather_api/README.md +178 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/weather_api/__init__.py +12 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/weather_api/skill.py +191 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/web_search/README.md +163 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/web_search/__init__.py +10 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/web_search/skill.py +747 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/web_search/skill_improved.py +547 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/web_search/skill_original.py +344 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/wikipedia_search/README.md +228 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/wikipedia_search/__init__.py +18 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/skills/wikipedia_search/skill.py +210 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/utils/__init__.py +24 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/utils/pom_utils.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/utils/schema_utils.py +529 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/utils/token_generators.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/utils/url_validator.py +88 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/utils/validators.py +9 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/web/__init__.py +17 -0
- signalwire_sdk-3.0.0/signalwire/signalwire/web/web_service.py +568 -0
- signalwire_sdk-3.0.0/signalwire/signalwire_sdk.egg-info/PKG-INFO +358 -0
- signalwire_sdk-3.0.0/signalwire/signalwire_sdk.egg-info/SOURCES.txt +203 -0
- signalwire_sdk-3.0.0/signalwire/signalwire_sdk.egg-info/dependency_links.txt +1 -0
- signalwire_sdk-3.0.0/signalwire/signalwire_sdk.egg-info/entry_points.txt +7 -0
- signalwire_sdk-3.0.0/signalwire/signalwire_sdk.egg-info/requires.txt +83 -0
- signalwire_sdk-3.0.0/signalwire/signalwire_sdk.egg-info/top_level.txt +1 -0
- signalwire_sdk-3.0.0/tests/test_examples.py +510 -0
- signalwire_sdk-3.0.0/tests/test_mcp_integration.py +225 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SignalWire
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: signalwire-sdk
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: SignalWire SDK
|
|
5
|
+
Author-email: SignalWire Team <info@signalwire.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/signalwire/signalwire-agents
|
|
8
|
+
Keywords: signalwire,ai,agents,voice,telephony,swaig,swml
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: fastapi>=0.115.12
|
|
21
|
+
Requires-Dist: pydantic>=2.11.4
|
|
22
|
+
Requires-Dist: PyYAML>=6.0.2
|
|
23
|
+
Requires-Dist: Requests>=2.32.3
|
|
24
|
+
Requires-Dist: setuptools<81,>=66.1.1
|
|
25
|
+
Requires-Dist: docopt>=0.6.2
|
|
26
|
+
Requires-Dist: structlog>=25.3.0
|
|
27
|
+
Requires-Dist: uvicorn>=0.34.2
|
|
28
|
+
Requires-Dist: beautifulsoup4>=4.12.3
|
|
29
|
+
Requires-Dist: pytz>=2023.3
|
|
30
|
+
Requires-Dist: lxml>=4.9.0
|
|
31
|
+
Requires-Dist: jsonschema-rs>=0.20.0
|
|
32
|
+
Requires-Dist: websockets>=12.0
|
|
33
|
+
Provides-Extra: search-queryonly
|
|
34
|
+
Requires-Dist: numpy>=1.24.0; extra == "search-queryonly"
|
|
35
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "search-queryonly"
|
|
36
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "search-queryonly"
|
|
37
|
+
Requires-Dist: nltk>=3.8; extra == "search-queryonly"
|
|
38
|
+
Provides-Extra: search
|
|
39
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "search"
|
|
40
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "search"
|
|
41
|
+
Requires-Dist: nltk>=3.8; extra == "search"
|
|
42
|
+
Requires-Dist: numpy>=1.24.0; extra == "search"
|
|
43
|
+
Provides-Extra: search-full
|
|
44
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "search-full"
|
|
45
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "search-full"
|
|
46
|
+
Requires-Dist: nltk>=3.8; extra == "search-full"
|
|
47
|
+
Requires-Dist: numpy>=1.24.0; extra == "search-full"
|
|
48
|
+
Requires-Dist: pdfplumber>=0.9.0; extra == "search-full"
|
|
49
|
+
Requires-Dist: python-docx>=0.8.11; extra == "search-full"
|
|
50
|
+
Requires-Dist: markdown>=3.4.0; extra == "search-full"
|
|
51
|
+
Requires-Dist: striprtf>=0.0.26; extra == "search-full"
|
|
52
|
+
Requires-Dist: openpyxl>=3.1.0; extra == "search-full"
|
|
53
|
+
Requires-Dist: python-pptx>=0.6.21; extra == "search-full"
|
|
54
|
+
Requires-Dist: python-magic>=0.4.27; extra == "search-full"
|
|
55
|
+
Provides-Extra: search-nlp
|
|
56
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "search-nlp"
|
|
57
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "search-nlp"
|
|
58
|
+
Requires-Dist: nltk>=3.8; extra == "search-nlp"
|
|
59
|
+
Requires-Dist: numpy>=1.24.0; extra == "search-nlp"
|
|
60
|
+
Requires-Dist: spacy>=3.6.0; extra == "search-nlp"
|
|
61
|
+
Provides-Extra: search-all
|
|
62
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "search-all"
|
|
63
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "search-all"
|
|
64
|
+
Requires-Dist: nltk>=3.8; extra == "search-all"
|
|
65
|
+
Requires-Dist: numpy>=1.24.0; extra == "search-all"
|
|
66
|
+
Requires-Dist: spacy>=3.6.0; extra == "search-all"
|
|
67
|
+
Requires-Dist: pdfplumber>=0.9.0; extra == "search-all"
|
|
68
|
+
Requires-Dist: python-docx>=0.8.11; extra == "search-all"
|
|
69
|
+
Requires-Dist: markdown>=3.4.0; extra == "search-all"
|
|
70
|
+
Requires-Dist: striprtf>=0.0.26; extra == "search-all"
|
|
71
|
+
Requires-Dist: openpyxl>=3.1.0; extra == "search-all"
|
|
72
|
+
Requires-Dist: python-pptx>=0.6.21; extra == "search-all"
|
|
73
|
+
Requires-Dist: python-magic>=0.4.27; extra == "search-all"
|
|
74
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "search-all"
|
|
75
|
+
Requires-Dist: pgvector>=0.2.0; extra == "search-all"
|
|
76
|
+
Provides-Extra: pgvector
|
|
77
|
+
Requires-Dist: psycopg2-binary>=2.9.0; extra == "pgvector"
|
|
78
|
+
Requires-Dist: pgvector>=0.2.0; extra == "pgvector"
|
|
79
|
+
Provides-Extra: mcp-gateway
|
|
80
|
+
Requires-Dist: flask>=2.0.0; extra == "mcp-gateway"
|
|
81
|
+
Requires-Dist: flask-limiter>=3.5.0; extra == "mcp-gateway"
|
|
82
|
+
Provides-Extra: all
|
|
83
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
|
|
84
|
+
Requires-Dist: scikit-learn>=1.3.0; extra == "all"
|
|
85
|
+
Requires-Dist: nltk>=3.8; extra == "all"
|
|
86
|
+
Requires-Dist: numpy>=1.24.0; extra == "all"
|
|
87
|
+
Requires-Dist: spacy>=3.6.0; extra == "all"
|
|
88
|
+
Requires-Dist: pdfplumber>=0.9.0; extra == "all"
|
|
89
|
+
Requires-Dist: python-docx>=0.8.11; extra == "all"
|
|
90
|
+
Requires-Dist: markdown>=3.4.0; extra == "all"
|
|
91
|
+
Requires-Dist: striprtf>=0.0.26; extra == "all"
|
|
92
|
+
Requires-Dist: openpyxl>=3.1.0; extra == "all"
|
|
93
|
+
Requires-Dist: python-pptx>=0.6.21; extra == "all"
|
|
94
|
+
Requires-Dist: python-magic>=0.4.27; extra == "all"
|
|
95
|
+
Dynamic: license-file
|
|
96
|
+
|
|
97
|
+
<!-- Header -->
|
|
98
|
+
<div align="center">
|
|
99
|
+
<a href="https://signalwire.com" target="_blank">
|
|
100
|
+
<img src="https://github.com/user-attachments/assets/0c8ed3b9-8c50-4dc6-9cc4-cc6cd137fd50" width="500" />
|
|
101
|
+
</a>
|
|
102
|
+
|
|
103
|
+
# SignalWire SDK for Python
|
|
104
|
+
|
|
105
|
+
_Build AI voice agents, control live calls over WebSocket, and manage every SignalWire resource over REST -- all from one package._
|
|
106
|
+
|
|
107
|
+
<p align="center">
|
|
108
|
+
<a href="https://developer.signalwire.com/sdks/agents-sdk" target="_blank">Documentation</a> ·
|
|
109
|
+
<a href="https://github.com/signalwire/signalwire-docs/issues/new/choose" target="_blank">Report an Issue</a> ·
|
|
110
|
+
<a href="https://pypi.org/project/signalwire/" target="_blank">PyPI</a>
|
|
111
|
+
</p>
|
|
112
|
+
|
|
113
|
+
<a href="https://discord.com/invite/F2WNYTNjuF" target="_blank"><img src="https://img.shields.io/badge/Discord%20Community-5865F2" alt="Discord" /></a>
|
|
114
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/MIT-License-blue" alt="MIT License" /></a>
|
|
115
|
+
<a href="https://github.com/signalwire/signalwire-python" target="_blank"><img src="https://img.shields.io/github/stars/signalwire/signalwire-python" alt="GitHub Stars" /></a>
|
|
116
|
+
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## What's in this SDK
|
|
122
|
+
|
|
123
|
+
| Capability | What it does | Quick link |
|
|
124
|
+
|-----------|-------------|------------|
|
|
125
|
+
| **AI Agents** | Build voice agents that handle calls autonomously -- the platform runs the AI pipeline, your code defines the persona, tools, and call flow | [Agent Guide](#ai-agents) |
|
|
126
|
+
| **RELAY Client** | Control live calls and SMS/MMS in real time over WebSocket -- answer, play, record, collect DTMF, conference, transfer, and more | [RELAY docs](relay/README.md) |
|
|
127
|
+
| **REST Client** | Manage SignalWire resources over HTTP -- phone numbers, SIP endpoints, Fabric AI agents, video rooms, messaging, and 18+ API namespaces | [REST docs](rest/README.md) |
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
pip install signalwire
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## AI Agents
|
|
136
|
+
|
|
137
|
+
Each agent is a self-contained microservice that generates [SWML](docs/swml_service_guide.md) (SignalWire Markup Language) and handles [SWAIG](docs/swaig_reference.md) (SignalWire AI Gateway) tool calls. The SignalWire platform runs the entire AI pipeline (STT, LLM, TTS) -- your agent just defines the behavior.
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from signalwire import AgentBase
|
|
141
|
+
from signalwire.core.function_result import FunctionResult
|
|
142
|
+
|
|
143
|
+
class MyAgent(AgentBase):
|
|
144
|
+
def __init__(self):
|
|
145
|
+
super().__init__(name="my-agent", route="/agent")
|
|
146
|
+
|
|
147
|
+
self.add_language(name="English", code="en-US", voice="inworld.Mark")
|
|
148
|
+
self.prompt_add_section("Role", body="You are a helpful assistant.")
|
|
149
|
+
|
|
150
|
+
@AgentBase.tool(name="get_time")
|
|
151
|
+
def get_time(self):
|
|
152
|
+
"""Get the current time"""
|
|
153
|
+
from datetime import datetime
|
|
154
|
+
return FunctionResult(f"The time is {datetime.now().strftime('%H:%M:%S')}")
|
|
155
|
+
|
|
156
|
+
if __name__ == "__main__":
|
|
157
|
+
agent = MyAgent()
|
|
158
|
+
agent.run()
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Test locally without running a server:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
swaig-test my_agent.py --list-tools
|
|
165
|
+
swaig-test my_agent.py --dump-swml
|
|
166
|
+
swaig-test my_agent.py --exec get_time
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Agent Features
|
|
170
|
+
|
|
171
|
+
- **Prompt Object Model (POM)** -- structured prompt composition via `prompt_add_section()`
|
|
172
|
+
- **SWAIG tools** -- define functions with `@AgentBase.tool()` that the AI calls mid-conversation, with native access to the call's media stack
|
|
173
|
+
- **Skills system** -- add capabilities with one-liners: `agent.add_skill("datetime")`
|
|
174
|
+
- **Contexts and steps** -- structured multi-step workflows with navigation control
|
|
175
|
+
- **DataMap tools** -- tools that execute on SignalWire's servers, calling REST APIs without your own webhook
|
|
176
|
+
- **Dynamic configuration** -- per-request agent customization for multi-tenant deployments
|
|
177
|
+
- **Call flow control** -- pre-answer, post-answer, and post-AI verb insertion
|
|
178
|
+
- **Prefab agents** -- ready-to-use archetypes (InfoGatherer, Survey, FAQ, Receptionist, Concierge)
|
|
179
|
+
- **Multi-agent hosting** -- serve multiple agents on a single server with `AgentServer`
|
|
180
|
+
- **Local search** -- offline document search with vector similarity and keyword matching
|
|
181
|
+
- **SIP routing** -- route SIP calls to agents based on usernames
|
|
182
|
+
- **Session state** -- persistent conversation state with global data and post-prompt summaries
|
|
183
|
+
- **Security** -- auto-generated basic auth, function-specific HMAC tokens, SSL support
|
|
184
|
+
- **Serverless** -- auto-detects Lambda, CGI, Google Cloud Functions, Azure Functions
|
|
185
|
+
|
|
186
|
+
### Agent Examples
|
|
187
|
+
|
|
188
|
+
The [`examples/`](examples/) directory contains 50+ working examples:
|
|
189
|
+
|
|
190
|
+
| Example | What it demonstrates |
|
|
191
|
+
|---------|---------------------|
|
|
192
|
+
| [simple_agent.py](examples/simple_agent.py) | POM prompts, SWAIG tools, multilingual support, LLM tuning |
|
|
193
|
+
| [contexts_demo.py](examples/contexts_demo.py) | Multi-persona workflow with context switching and step navigation |
|
|
194
|
+
| [data_map_demo.py](examples/data_map_demo.py) | Server-side API tools without webhooks |
|
|
195
|
+
| [skills_demo.py](examples/skills_demo.py) | Loading built-in skills (datetime, math) |
|
|
196
|
+
| [call_flow_and_actions_demo.py](examples/call_flow_and_actions_demo.py) | Call flow verbs, debug events, FunctionResult actions |
|
|
197
|
+
| [session_and_state_demo.py](examples/session_and_state_demo.py) | on_summary, global data, post-prompt summaries |
|
|
198
|
+
| [multi_agent_server.py](examples/multi_agent_server.py) | Multiple agents on one server |
|
|
199
|
+
| [lambda_agent.py](examples/lambda_agent.py) | AWS Lambda deployment with Mangum |
|
|
200
|
+
| [comprehensive_dynamic_agent.py](examples/comprehensive_dynamic_agent.py) | Per-request dynamic configuration, multi-tenant routing |
|
|
201
|
+
|
|
202
|
+
See [examples/README.md](examples/README.md) for the full list organized by category.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## RELAY Client
|
|
207
|
+
|
|
208
|
+
Real-time call control and messaging over WebSocket. The RELAY client connects to SignalWire via the Blade protocol and gives you imperative, async control over live phone calls and SMS/MMS.
|
|
209
|
+
|
|
210
|
+
```python
|
|
211
|
+
from signalwire.relay import RelayClient
|
|
212
|
+
|
|
213
|
+
client = RelayClient(project="...", token="...", host="example.signalwire.com", contexts=["default"])
|
|
214
|
+
|
|
215
|
+
@client.on_call
|
|
216
|
+
async def handle(call):
|
|
217
|
+
await call.answer()
|
|
218
|
+
action = await call.play([{"type": "tts", "params": {"text": "Welcome!"}}])
|
|
219
|
+
await action.wait()
|
|
220
|
+
await call.hangup()
|
|
221
|
+
|
|
222
|
+
client.run()
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
- 57+ calling methods (play, record, collect, detect, tap, stream, AI, conferencing, and more)
|
|
226
|
+
- SMS/MMS messaging with delivery tracking
|
|
227
|
+
- Action objects with `wait()`, `stop()`, `pause()`, `resume()`
|
|
228
|
+
- Auto-reconnect with exponential backoff
|
|
229
|
+
|
|
230
|
+
See the **[RELAY documentation](relay/README.md)** for the full guide, API reference, and examples.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## REST Client
|
|
235
|
+
|
|
236
|
+
Synchronous REST client for managing SignalWire resources and controlling calls over HTTP. No WebSocket required.
|
|
237
|
+
|
|
238
|
+
```python
|
|
239
|
+
from signalwire.rest import RestClient
|
|
240
|
+
|
|
241
|
+
client = RestClient(project="...", token="...", host="example.signalwire.com")
|
|
242
|
+
|
|
243
|
+
client.fabric.ai_agents.create(name="Support Bot", prompt={"text": "You are helpful."})
|
|
244
|
+
client.calling.play(call_id, play=[{"type": "tts", "text": "Hello!"}])
|
|
245
|
+
client.phone_numbers.search(area_code="512")
|
|
246
|
+
client.datasphere.documents.search(query_string="billing policy")
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
- 21 namespaced API surfaces: Fabric (13 resource types), Calling (37 commands), Video, Datasphere, Compat (Twilio-compatible), Phone Numbers, SIP, Queues, Recordings, and more
|
|
250
|
+
- Shared `requests.Session` for connection pooling
|
|
251
|
+
- Dict returns -- raw JSON, no wrapper objects
|
|
252
|
+
|
|
253
|
+
See the **[REST documentation](rest/README.md)** for the full guide, API reference, and examples.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Installation
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Core SDK (agents, RELAY, REST)
|
|
261
|
+
pip install signalwire
|
|
262
|
+
|
|
263
|
+
# With search (pick one based on your needs)
|
|
264
|
+
pip install signalwire[search-queryonly] # Query pre-built .swsearch files (~400MB)
|
|
265
|
+
pip install signalwire[search] # Build + query search indexes (~500MB)
|
|
266
|
+
pip install signalwire[search-full] # + PDF, DOCX, Excel, HTML processing (~600MB)
|
|
267
|
+
pip install signalwire[search-all] # All search features (~700MB)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Documentation
|
|
271
|
+
|
|
272
|
+
Full reference documentation is available at **[developer.signalwire.com/sdks/agents-sdk](https://developer.signalwire.com/sdks/agents-sdk)**.
|
|
273
|
+
|
|
274
|
+
Guides are also available in the [`docs/`](docs/) directory:
|
|
275
|
+
|
|
276
|
+
### Getting Started
|
|
277
|
+
|
|
278
|
+
- [Agent Guide](docs/agent_guide.md) -- creating agents, prompt configuration, dynamic setup
|
|
279
|
+
- [Architecture](docs/architecture.md) -- SDK architecture and core concepts
|
|
280
|
+
- [SDK Features](docs/sdk_features.md) -- feature overview, SDK vs raw SWML comparison
|
|
281
|
+
|
|
282
|
+
### Core Features
|
|
283
|
+
|
|
284
|
+
- [SWAIG Reference](docs/swaig_reference.md) -- function results, actions, post_data lifecycle
|
|
285
|
+
- [Contexts and Steps](docs/contexts_guide.md) -- structured workflows, navigation, gather mode
|
|
286
|
+
- [DataMap Guide](docs/datamap_guide.md) -- serverless API tools without webhooks
|
|
287
|
+
- [LLM Parameters](docs/llm_parameters.md) -- temperature, top_p, barge confidence tuning
|
|
288
|
+
- [SWML Service Guide](docs/swml_service_guide.md) -- low-level construction of SWML documents
|
|
289
|
+
|
|
290
|
+
### Skills and Extensions
|
|
291
|
+
|
|
292
|
+
- [Skills System](docs/skills_system.md) -- built-in skills and the modular framework
|
|
293
|
+
- [Third-Party Skills](docs/third_party_skills.md) -- creating and publishing custom skills
|
|
294
|
+
- [MCP Gateway](docs/mcp_gateway_reference.md) -- Model Context Protocol integration
|
|
295
|
+
|
|
296
|
+
### Search System
|
|
297
|
+
|
|
298
|
+
- [Search Overview](docs/search_overview.md) -- architecture, installation, quick start
|
|
299
|
+
- [Search Indexing](docs/search_indexing.md) -- building indexes, chunking, embeddings
|
|
300
|
+
- [Search Integration](docs/search_integration.md) -- agent integration, skills, HTTP API
|
|
301
|
+
- [Search Deployment](docs/search_deployment.md) -- production deployment, pgvector, scaling
|
|
302
|
+
|
|
303
|
+
### Deployment
|
|
304
|
+
|
|
305
|
+
- [CLI Guide](docs/cli_guide.md) -- `swaig-test` and `sw-search` command reference
|
|
306
|
+
- [Cloud Functions](docs/cloud_functions_guide.md) -- Lambda, Cloud Functions, Azure deployment
|
|
307
|
+
- [Bedrock Agent](docs/bedrock_agent.md) -- Amazon Bedrock integration
|
|
308
|
+
- [Configuration](docs/configuration.md) -- environment variables, SSL, proxy setup
|
|
309
|
+
- [Security](docs/security.md) -- authentication and security model
|
|
310
|
+
|
|
311
|
+
### Reference
|
|
312
|
+
|
|
313
|
+
- [API Reference](docs/api_reference.md) -- complete class and method reference
|
|
314
|
+
- [Web Service](docs/web_service.md) -- HTTP server and endpoint details
|
|
315
|
+
- [Skills Parameter Schema](docs/skills_parameter_schema.md) -- skill parameter definitions
|
|
316
|
+
|
|
317
|
+
### Tutorials
|
|
318
|
+
|
|
319
|
+
- [Multi-Agent Tutorial](tutorial/multi_agents/README.md) -- 5-lesson guide from first agent to multi-agent systems
|
|
320
|
+
- [Fred Bot Tutorial](tutorial/fred/tutorial/README.md) -- build a Wikipedia AI assistant step-by-step
|
|
321
|
+
|
|
322
|
+
## Environment Variables
|
|
323
|
+
|
|
324
|
+
| Variable | Used by | Description |
|
|
325
|
+
|----------|---------|-------------|
|
|
326
|
+
| `SIGNALWIRE_PROJECT_ID` | RELAY, REST | Project identifier |
|
|
327
|
+
| `SIGNALWIRE_API_TOKEN` | RELAY, REST | API token |
|
|
328
|
+
| `SIGNALWIRE_SPACE` | RELAY, REST | Space hostname (e.g. `example.signalwire.com`) |
|
|
329
|
+
| `SWML_BASIC_AUTH_USER` | Agents | Basic auth username (default: auto-generated) |
|
|
330
|
+
| `SWML_BASIC_AUTH_PASSWORD` | Agents | Basic auth password (default: auto-generated) |
|
|
331
|
+
| `SWML_PROXY_URL_BASE` | Agents | Base URL when behind a reverse proxy |
|
|
332
|
+
| `SWML_SSL_ENABLED` | Agents | Enable HTTPS (`true`, `1`, `yes`) |
|
|
333
|
+
| `SWML_SSL_CERT_PATH` | Agents | Path to SSL certificate |
|
|
334
|
+
| `SWML_SSL_KEY_PATH` | Agents | Path to SSL private key |
|
|
335
|
+
| `SIGNALWIRE_LOG_LEVEL` | All | Logging level (`debug`, `info`, `warn`, `error`) |
|
|
336
|
+
| `SIGNALWIRE_LOG_MODE` | All | Set to `off` to suppress all logging |
|
|
337
|
+
|
|
338
|
+
## Testing
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
# Install dev dependencies
|
|
342
|
+
pip install -r requirements-dev.txt
|
|
343
|
+
|
|
344
|
+
# Run the test suite
|
|
345
|
+
pytest
|
|
346
|
+
|
|
347
|
+
# Run by category
|
|
348
|
+
pytest -m unit
|
|
349
|
+
pytest -m integration
|
|
350
|
+
pytest -m skills
|
|
351
|
+
|
|
352
|
+
# Coverage
|
|
353
|
+
pytest --cov=signalwire --cov-report=html
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## License
|
|
357
|
+
|
|
358
|
+
MIT -- see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
<!-- Header -->
|
|
2
|
+
<div align="center">
|
|
3
|
+
<a href="https://signalwire.com" target="_blank">
|
|
4
|
+
<img src="https://github.com/user-attachments/assets/0c8ed3b9-8c50-4dc6-9cc4-cc6cd137fd50" width="500" />
|
|
5
|
+
</a>
|
|
6
|
+
|
|
7
|
+
# SignalWire SDK for Python
|
|
8
|
+
|
|
9
|
+
_Build AI voice agents, control live calls over WebSocket, and manage every SignalWire resource over REST -- all from one package._
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://developer.signalwire.com/sdks/agents-sdk" target="_blank">Documentation</a> ·
|
|
13
|
+
<a href="https://github.com/signalwire/signalwire-docs/issues/new/choose" target="_blank">Report an Issue</a> ·
|
|
14
|
+
<a href="https://pypi.org/project/signalwire/" target="_blank">PyPI</a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<a href="https://discord.com/invite/F2WNYTNjuF" target="_blank"><img src="https://img.shields.io/badge/Discord%20Community-5865F2" alt="Discord" /></a>
|
|
18
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/MIT-License-blue" alt="MIT License" /></a>
|
|
19
|
+
<a href="https://github.com/signalwire/signalwire-python" target="_blank"><img src="https://img.shields.io/github/stars/signalwire/signalwire-python" alt="GitHub Stars" /></a>
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## What's in this SDK
|
|
26
|
+
|
|
27
|
+
| Capability | What it does | Quick link |
|
|
28
|
+
|-----------|-------------|------------|
|
|
29
|
+
| **AI Agents** | Build voice agents that handle calls autonomously -- the platform runs the AI pipeline, your code defines the persona, tools, and call flow | [Agent Guide](#ai-agents) |
|
|
30
|
+
| **RELAY Client** | Control live calls and SMS/MMS in real time over WebSocket -- answer, play, record, collect DTMF, conference, transfer, and more | [RELAY docs](relay/README.md) |
|
|
31
|
+
| **REST Client** | Manage SignalWire resources over HTTP -- phone numbers, SIP endpoints, Fabric AI agents, video rooms, messaging, and 18+ API namespaces | [REST docs](rest/README.md) |
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install signalwire
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## AI Agents
|
|
40
|
+
|
|
41
|
+
Each agent is a self-contained microservice that generates [SWML](docs/swml_service_guide.md) (SignalWire Markup Language) and handles [SWAIG](docs/swaig_reference.md) (SignalWire AI Gateway) tool calls. The SignalWire platform runs the entire AI pipeline (STT, LLM, TTS) -- your agent just defines the behavior.
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from signalwire import AgentBase
|
|
45
|
+
from signalwire.core.function_result import FunctionResult
|
|
46
|
+
|
|
47
|
+
class MyAgent(AgentBase):
|
|
48
|
+
def __init__(self):
|
|
49
|
+
super().__init__(name="my-agent", route="/agent")
|
|
50
|
+
|
|
51
|
+
self.add_language(name="English", code="en-US", voice="inworld.Mark")
|
|
52
|
+
self.prompt_add_section("Role", body="You are a helpful assistant.")
|
|
53
|
+
|
|
54
|
+
@AgentBase.tool(name="get_time")
|
|
55
|
+
def get_time(self):
|
|
56
|
+
"""Get the current time"""
|
|
57
|
+
from datetime import datetime
|
|
58
|
+
return FunctionResult(f"The time is {datetime.now().strftime('%H:%M:%S')}")
|
|
59
|
+
|
|
60
|
+
if __name__ == "__main__":
|
|
61
|
+
agent = MyAgent()
|
|
62
|
+
agent.run()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Test locally without running a server:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
swaig-test my_agent.py --list-tools
|
|
69
|
+
swaig-test my_agent.py --dump-swml
|
|
70
|
+
swaig-test my_agent.py --exec get_time
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Agent Features
|
|
74
|
+
|
|
75
|
+
- **Prompt Object Model (POM)** -- structured prompt composition via `prompt_add_section()`
|
|
76
|
+
- **SWAIG tools** -- define functions with `@AgentBase.tool()` that the AI calls mid-conversation, with native access to the call's media stack
|
|
77
|
+
- **Skills system** -- add capabilities with one-liners: `agent.add_skill("datetime")`
|
|
78
|
+
- **Contexts and steps** -- structured multi-step workflows with navigation control
|
|
79
|
+
- **DataMap tools** -- tools that execute on SignalWire's servers, calling REST APIs without your own webhook
|
|
80
|
+
- **Dynamic configuration** -- per-request agent customization for multi-tenant deployments
|
|
81
|
+
- **Call flow control** -- pre-answer, post-answer, and post-AI verb insertion
|
|
82
|
+
- **Prefab agents** -- ready-to-use archetypes (InfoGatherer, Survey, FAQ, Receptionist, Concierge)
|
|
83
|
+
- **Multi-agent hosting** -- serve multiple agents on a single server with `AgentServer`
|
|
84
|
+
- **Local search** -- offline document search with vector similarity and keyword matching
|
|
85
|
+
- **SIP routing** -- route SIP calls to agents based on usernames
|
|
86
|
+
- **Session state** -- persistent conversation state with global data and post-prompt summaries
|
|
87
|
+
- **Security** -- auto-generated basic auth, function-specific HMAC tokens, SSL support
|
|
88
|
+
- **Serverless** -- auto-detects Lambda, CGI, Google Cloud Functions, Azure Functions
|
|
89
|
+
|
|
90
|
+
### Agent Examples
|
|
91
|
+
|
|
92
|
+
The [`examples/`](examples/) directory contains 50+ working examples:
|
|
93
|
+
|
|
94
|
+
| Example | What it demonstrates |
|
|
95
|
+
|---------|---------------------|
|
|
96
|
+
| [simple_agent.py](examples/simple_agent.py) | POM prompts, SWAIG tools, multilingual support, LLM tuning |
|
|
97
|
+
| [contexts_demo.py](examples/contexts_demo.py) | Multi-persona workflow with context switching and step navigation |
|
|
98
|
+
| [data_map_demo.py](examples/data_map_demo.py) | Server-side API tools without webhooks |
|
|
99
|
+
| [skills_demo.py](examples/skills_demo.py) | Loading built-in skills (datetime, math) |
|
|
100
|
+
| [call_flow_and_actions_demo.py](examples/call_flow_and_actions_demo.py) | Call flow verbs, debug events, FunctionResult actions |
|
|
101
|
+
| [session_and_state_demo.py](examples/session_and_state_demo.py) | on_summary, global data, post-prompt summaries |
|
|
102
|
+
| [multi_agent_server.py](examples/multi_agent_server.py) | Multiple agents on one server |
|
|
103
|
+
| [lambda_agent.py](examples/lambda_agent.py) | AWS Lambda deployment with Mangum |
|
|
104
|
+
| [comprehensive_dynamic_agent.py](examples/comprehensive_dynamic_agent.py) | Per-request dynamic configuration, multi-tenant routing |
|
|
105
|
+
|
|
106
|
+
See [examples/README.md](examples/README.md) for the full list organized by category.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## RELAY Client
|
|
111
|
+
|
|
112
|
+
Real-time call control and messaging over WebSocket. The RELAY client connects to SignalWire via the Blade protocol and gives you imperative, async control over live phone calls and SMS/MMS.
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from signalwire.relay import RelayClient
|
|
116
|
+
|
|
117
|
+
client = RelayClient(project="...", token="...", host="example.signalwire.com", contexts=["default"])
|
|
118
|
+
|
|
119
|
+
@client.on_call
|
|
120
|
+
async def handle(call):
|
|
121
|
+
await call.answer()
|
|
122
|
+
action = await call.play([{"type": "tts", "params": {"text": "Welcome!"}}])
|
|
123
|
+
await action.wait()
|
|
124
|
+
await call.hangup()
|
|
125
|
+
|
|
126
|
+
client.run()
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- 57+ calling methods (play, record, collect, detect, tap, stream, AI, conferencing, and more)
|
|
130
|
+
- SMS/MMS messaging with delivery tracking
|
|
131
|
+
- Action objects with `wait()`, `stop()`, `pause()`, `resume()`
|
|
132
|
+
- Auto-reconnect with exponential backoff
|
|
133
|
+
|
|
134
|
+
See the **[RELAY documentation](relay/README.md)** for the full guide, API reference, and examples.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## REST Client
|
|
139
|
+
|
|
140
|
+
Synchronous REST client for managing SignalWire resources and controlling calls over HTTP. No WebSocket required.
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from signalwire.rest import RestClient
|
|
144
|
+
|
|
145
|
+
client = RestClient(project="...", token="...", host="example.signalwire.com")
|
|
146
|
+
|
|
147
|
+
client.fabric.ai_agents.create(name="Support Bot", prompt={"text": "You are helpful."})
|
|
148
|
+
client.calling.play(call_id, play=[{"type": "tts", "text": "Hello!"}])
|
|
149
|
+
client.phone_numbers.search(area_code="512")
|
|
150
|
+
client.datasphere.documents.search(query_string="billing policy")
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
- 21 namespaced API surfaces: Fabric (13 resource types), Calling (37 commands), Video, Datasphere, Compat (Twilio-compatible), Phone Numbers, SIP, Queues, Recordings, and more
|
|
154
|
+
- Shared `requests.Session` for connection pooling
|
|
155
|
+
- Dict returns -- raw JSON, no wrapper objects
|
|
156
|
+
|
|
157
|
+
See the **[REST documentation](rest/README.md)** for the full guide, API reference, and examples.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Installation
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Core SDK (agents, RELAY, REST)
|
|
165
|
+
pip install signalwire
|
|
166
|
+
|
|
167
|
+
# With search (pick one based on your needs)
|
|
168
|
+
pip install signalwire[search-queryonly] # Query pre-built .swsearch files (~400MB)
|
|
169
|
+
pip install signalwire[search] # Build + query search indexes (~500MB)
|
|
170
|
+
pip install signalwire[search-full] # + PDF, DOCX, Excel, HTML processing (~600MB)
|
|
171
|
+
pip install signalwire[search-all] # All search features (~700MB)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Documentation
|
|
175
|
+
|
|
176
|
+
Full reference documentation is available at **[developer.signalwire.com/sdks/agents-sdk](https://developer.signalwire.com/sdks/agents-sdk)**.
|
|
177
|
+
|
|
178
|
+
Guides are also available in the [`docs/`](docs/) directory:
|
|
179
|
+
|
|
180
|
+
### Getting Started
|
|
181
|
+
|
|
182
|
+
- [Agent Guide](docs/agent_guide.md) -- creating agents, prompt configuration, dynamic setup
|
|
183
|
+
- [Architecture](docs/architecture.md) -- SDK architecture and core concepts
|
|
184
|
+
- [SDK Features](docs/sdk_features.md) -- feature overview, SDK vs raw SWML comparison
|
|
185
|
+
|
|
186
|
+
### Core Features
|
|
187
|
+
|
|
188
|
+
- [SWAIG Reference](docs/swaig_reference.md) -- function results, actions, post_data lifecycle
|
|
189
|
+
- [Contexts and Steps](docs/contexts_guide.md) -- structured workflows, navigation, gather mode
|
|
190
|
+
- [DataMap Guide](docs/datamap_guide.md) -- serverless API tools without webhooks
|
|
191
|
+
- [LLM Parameters](docs/llm_parameters.md) -- temperature, top_p, barge confidence tuning
|
|
192
|
+
- [SWML Service Guide](docs/swml_service_guide.md) -- low-level construction of SWML documents
|
|
193
|
+
|
|
194
|
+
### Skills and Extensions
|
|
195
|
+
|
|
196
|
+
- [Skills System](docs/skills_system.md) -- built-in skills and the modular framework
|
|
197
|
+
- [Third-Party Skills](docs/third_party_skills.md) -- creating and publishing custom skills
|
|
198
|
+
- [MCP Gateway](docs/mcp_gateway_reference.md) -- Model Context Protocol integration
|
|
199
|
+
|
|
200
|
+
### Search System
|
|
201
|
+
|
|
202
|
+
- [Search Overview](docs/search_overview.md) -- architecture, installation, quick start
|
|
203
|
+
- [Search Indexing](docs/search_indexing.md) -- building indexes, chunking, embeddings
|
|
204
|
+
- [Search Integration](docs/search_integration.md) -- agent integration, skills, HTTP API
|
|
205
|
+
- [Search Deployment](docs/search_deployment.md) -- production deployment, pgvector, scaling
|
|
206
|
+
|
|
207
|
+
### Deployment
|
|
208
|
+
|
|
209
|
+
- [CLI Guide](docs/cli_guide.md) -- `swaig-test` and `sw-search` command reference
|
|
210
|
+
- [Cloud Functions](docs/cloud_functions_guide.md) -- Lambda, Cloud Functions, Azure deployment
|
|
211
|
+
- [Bedrock Agent](docs/bedrock_agent.md) -- Amazon Bedrock integration
|
|
212
|
+
- [Configuration](docs/configuration.md) -- environment variables, SSL, proxy setup
|
|
213
|
+
- [Security](docs/security.md) -- authentication and security model
|
|
214
|
+
|
|
215
|
+
### Reference
|
|
216
|
+
|
|
217
|
+
- [API Reference](docs/api_reference.md) -- complete class and method reference
|
|
218
|
+
- [Web Service](docs/web_service.md) -- HTTP server and endpoint details
|
|
219
|
+
- [Skills Parameter Schema](docs/skills_parameter_schema.md) -- skill parameter definitions
|
|
220
|
+
|
|
221
|
+
### Tutorials
|
|
222
|
+
|
|
223
|
+
- [Multi-Agent Tutorial](tutorial/multi_agents/README.md) -- 5-lesson guide from first agent to multi-agent systems
|
|
224
|
+
- [Fred Bot Tutorial](tutorial/fred/tutorial/README.md) -- build a Wikipedia AI assistant step-by-step
|
|
225
|
+
|
|
226
|
+
## Environment Variables
|
|
227
|
+
|
|
228
|
+
| Variable | Used by | Description |
|
|
229
|
+
|----------|---------|-------------|
|
|
230
|
+
| `SIGNALWIRE_PROJECT_ID` | RELAY, REST | Project identifier |
|
|
231
|
+
| `SIGNALWIRE_API_TOKEN` | RELAY, REST | API token |
|
|
232
|
+
| `SIGNALWIRE_SPACE` | RELAY, REST | Space hostname (e.g. `example.signalwire.com`) |
|
|
233
|
+
| `SWML_BASIC_AUTH_USER` | Agents | Basic auth username (default: auto-generated) |
|
|
234
|
+
| `SWML_BASIC_AUTH_PASSWORD` | Agents | Basic auth password (default: auto-generated) |
|
|
235
|
+
| `SWML_PROXY_URL_BASE` | Agents | Base URL when behind a reverse proxy |
|
|
236
|
+
| `SWML_SSL_ENABLED` | Agents | Enable HTTPS (`true`, `1`, `yes`) |
|
|
237
|
+
| `SWML_SSL_CERT_PATH` | Agents | Path to SSL certificate |
|
|
238
|
+
| `SWML_SSL_KEY_PATH` | Agents | Path to SSL private key |
|
|
239
|
+
| `SIGNALWIRE_LOG_LEVEL` | All | Logging level (`debug`, `info`, `warn`, `error`) |
|
|
240
|
+
| `SIGNALWIRE_LOG_MODE` | All | Set to `off` to suppress all logging |
|
|
241
|
+
|
|
242
|
+
## Testing
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
# Install dev dependencies
|
|
246
|
+
pip install -r requirements-dev.txt
|
|
247
|
+
|
|
248
|
+
# Run the test suite
|
|
249
|
+
pytest
|
|
250
|
+
|
|
251
|
+
# Run by category
|
|
252
|
+
pytest -m unit
|
|
253
|
+
pytest -m integration
|
|
254
|
+
pytest -m skills
|
|
255
|
+
|
|
256
|
+
# Coverage
|
|
257
|
+
pytest --cov=signalwire --cov-report=html
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## License
|
|
261
|
+
|
|
262
|
+
MIT -- see [LICENSE](LICENSE) for details.
|