signalwire-agents 0.1.45__py3-none-any.whl → 0.1.46__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.
- signalwire_agents/__init__.py +1 -1
- signalwire_agents/core/agent/tools/registry.py +11 -1
- signalwire_agents/core/agent_base.py +19 -3
- signalwire_agents/core/swaig_function.py +8 -2
- {signalwire_agents-0.1.45.dist-info → signalwire_agents-0.1.46.dist-info}/METADATA +1 -1
- {signalwire_agents-0.1.45.dist-info → signalwire_agents-0.1.46.dist-info}/RECORD +10 -10
- {signalwire_agents-0.1.45.dist-info → signalwire_agents-0.1.46.dist-info}/WHEEL +0 -0
- {signalwire_agents-0.1.45.dist-info → signalwire_agents-0.1.46.dist-info}/entry_points.txt +0 -0
- {signalwire_agents-0.1.45.dist-info → signalwire_agents-0.1.46.dist-info}/licenses/LICENSE +0 -0
- {signalwire_agents-0.1.45.dist-info → signalwire_agents-0.1.46.dist-info}/top_level.txt +0 -0
signalwire_agents/__init__.py
CHANGED
@@ -18,7 +18,7 @@ A package for building AI agents using SignalWire's AI and SWML capabilities.
|
|
18
18
|
from .core.logging_config import configure_logging
|
19
19
|
configure_logging()
|
20
20
|
|
21
|
-
__version__ = "0.1.
|
21
|
+
__version__ = "0.1.46"
|
22
22
|
|
23
23
|
# Import core classes for easier access
|
24
24
|
from .core.agent_base import AgentBase
|
@@ -40,6 +40,8 @@ class ToolRegistry:
|
|
40
40
|
handler: Callable,
|
41
41
|
secure: bool = True,
|
42
42
|
fillers: Optional[Dict[str, List[str]]] = None,
|
43
|
+
wait_file: Optional[str] = None,
|
44
|
+
wait_file_loops: Optional[int] = None,
|
43
45
|
webhook_url: Optional[str] = None,
|
44
46
|
required: Optional[List[str]] = None,
|
45
47
|
**swaig_fields
|
@@ -53,7 +55,9 @@ class ToolRegistry:
|
|
53
55
|
parameters: JSON Schema of parameters
|
54
56
|
handler: Function to call when invoked
|
55
57
|
secure: Whether to require token validation
|
56
|
-
fillers: Optional dict mapping language codes to arrays of filler phrases
|
58
|
+
fillers: Optional dict mapping language codes to arrays of filler phrases (deprecated)
|
59
|
+
wait_file: Optional URL to audio file to play while function executes
|
60
|
+
wait_file_loops: Optional number of times to loop the wait_file
|
57
61
|
webhook_url: Optional external webhook URL to use instead of local handling
|
58
62
|
required: Optional list of required parameter names
|
59
63
|
**swaig_fields: Additional SWAIG fields to include in function definition
|
@@ -71,6 +75,8 @@ class ToolRegistry:
|
|
71
75
|
handler=handler,
|
72
76
|
secure=secure,
|
73
77
|
fillers=fillers,
|
78
|
+
wait_file=wait_file,
|
79
|
+
wait_file_loops=wait_file_loops,
|
74
80
|
webhook_url=webhook_url,
|
75
81
|
required=required,
|
76
82
|
**swaig_fields
|
@@ -132,6 +138,8 @@ class ToolRegistry:
|
|
132
138
|
parameters = tool_params_copy.pop("parameters", {})
|
133
139
|
secure = tool_params_copy.pop("secure", True)
|
134
140
|
fillers = tool_params_copy.pop("fillers", None)
|
141
|
+
wait_file = tool_params_copy.pop("wait_file", None)
|
142
|
+
wait_file_loops = tool_params_copy.pop("wait_file_loops", None)
|
135
143
|
webhook_url = tool_params_copy.pop("webhook_url", None)
|
136
144
|
required = tool_params_copy.pop("required", None)
|
137
145
|
|
@@ -143,6 +151,8 @@ class ToolRegistry:
|
|
143
151
|
handler=attr.__get__(self.agent, cls), # Bind the method to this instance
|
144
152
|
secure=secure,
|
145
153
|
fillers=fillers,
|
154
|
+
wait_file=wait_file,
|
155
|
+
wait_file_loops=wait_file_loops,
|
146
156
|
webhook_url=webhook_url,
|
147
157
|
required=required,
|
148
158
|
**tool_params_copy # Pass through any additional swaig_fields
|
@@ -692,9 +692,25 @@ class AgentBase(
|
|
692
692
|
"parameters": func._ensure_parameter_structure()
|
693
693
|
}
|
694
694
|
|
695
|
-
# Add
|
696
|
-
if func.
|
697
|
-
|
695
|
+
# Add wait_file if present (SignalWire SWML expects wait_file, not fillers)
|
696
|
+
if hasattr(func, 'wait_file') and func.wait_file:
|
697
|
+
wait_file_url = func.wait_file
|
698
|
+
# If wait_file is a relative URL, convert it to absolute using agent's base URL
|
699
|
+
if wait_file_url and not wait_file_url.startswith(('http://', 'https://', '//')):
|
700
|
+
# Build full URL using the agent's base URL
|
701
|
+
base_url = agent_to_use._get_base_url(include_auth=False)
|
702
|
+
# Handle relative paths appropriately
|
703
|
+
if not wait_file_url.startswith('/'):
|
704
|
+
wait_file_url = '/' + wait_file_url
|
705
|
+
wait_file_url = f"{base_url}{wait_file_url}"
|
706
|
+
function_entry["wait_file"] = wait_file_url
|
707
|
+
elif func.fillers:
|
708
|
+
# Backward compatibility: use fillers as wait_file if wait_file not specified
|
709
|
+
function_entry["wait_file"] = func.fillers
|
710
|
+
|
711
|
+
# Add wait_file_loops if present
|
712
|
+
if hasattr(func, 'wait_file_loops') and func.wait_file_loops is not None:
|
713
|
+
function_entry["wait_file_loops"] = func.wait_file_loops
|
698
714
|
|
699
715
|
# Handle webhook URL
|
700
716
|
if hasattr(func, 'webhook_url') and func.webhook_url:
|
@@ -30,6 +30,8 @@ class SWAIGFunction:
|
|
30
30
|
parameters: Dict[str, Dict] = None,
|
31
31
|
secure: bool = False,
|
32
32
|
fillers: Optional[Dict[str, List[str]]] = None,
|
33
|
+
wait_file: Optional[str] = None,
|
34
|
+
wait_file_loops: Optional[int] = None,
|
33
35
|
webhook_url: Optional[str] = None,
|
34
36
|
required: Optional[List[str]] = None,
|
35
37
|
**extra_swaig_fields
|
@@ -43,7 +45,9 @@ class SWAIGFunction:
|
|
43
45
|
description: Human-readable description of the function
|
44
46
|
parameters: Dictionary of parameters, keys are parameter names, values are param definitions
|
45
47
|
secure: Whether this function requires token validation
|
46
|
-
fillers: Optional dictionary of filler phrases by language code
|
48
|
+
fillers: Optional dictionary of filler phrases by language code (deprecated, use wait_file)
|
49
|
+
wait_file: Optional URL to audio file to play while function executes
|
50
|
+
wait_file_loops: Optional number of times to loop the wait_file
|
47
51
|
webhook_url: Optional external webhook URL to use instead of local handling
|
48
52
|
required: Optional list of required parameter names
|
49
53
|
**extra_swaig_fields: Additional SWAIG fields to include in function definition
|
@@ -53,7 +57,9 @@ class SWAIGFunction:
|
|
53
57
|
self.description = description
|
54
58
|
self.parameters = parameters or {}
|
55
59
|
self.secure = secure
|
56
|
-
self.fillers = fillers
|
60
|
+
self.fillers = fillers # Keep for backward compatibility
|
61
|
+
self.wait_file = wait_file or fillers # Use wait_file if provided, else fall back to fillers
|
62
|
+
self.wait_file_loops = wait_file_loops
|
57
63
|
self.webhook_url = webhook_url
|
58
64
|
self.required = required or []
|
59
65
|
self.extra_swaig_fields = extra_swaig_fields
|
@@ -1,4 +1,4 @@
|
|
1
|
-
signalwire_agents/__init__.py,sha256=
|
1
|
+
signalwire_agents/__init__.py,sha256=Hv5VQbfoIDYAidp17GYz_wbKRqSGKGQ87ZlHhhZ0DSM,5031
|
2
2
|
signalwire_agents/agent_server.py,sha256=x9HyWia8D3r6KMqY-Q4DtNVivfJWLTx8B-KzUI8okuA,26880
|
3
3
|
signalwire_agents/schema.json,sha256=6-7ccbt39iM1CO36dOfvupRPfd0gnQ0XoAdyo-EFyjo,238042
|
4
4
|
signalwire_agents/agents/bedrock.py,sha256=J582gooNtxtep4xdVOfyDzRtHp_XrurPMS93xf2Xod0,10836
|
@@ -24,7 +24,7 @@ signalwire_agents/cli/simulation/data_generation.py,sha256=pxa9aJ6XkI0O8yAIGvBTU
|
|
24
24
|
signalwire_agents/cli/simulation/data_overrides.py,sha256=3_3pT6j-q2gRufPX2bZ1BrmY7u1IdloLooKAJil33vI,6319
|
25
25
|
signalwire_agents/cli/simulation/mock_env.py,sha256=fvaR_xdLMm8AbpNUbTJOFG9THcti3Zds-0QNDbKMaYk,10249
|
26
26
|
signalwire_agents/core/__init__.py,sha256=xjPq8DmUnWYUG28sd17n430VWPmMH9oZ9W14gYwG96g,806
|
27
|
-
signalwire_agents/core/agent_base.py,sha256=
|
27
|
+
signalwire_agents/core/agent_base.py,sha256=vAx9sQ985juMi0lnfP7bw1fl_1iYRzXVIpPyE-xEFBE,50139
|
28
28
|
signalwire_agents/core/auth_handler.py,sha256=jXrof9WZ1W9qqlQT9WElcmSRafL2kG7207x5SqWN9MU,8481
|
29
29
|
signalwire_agents/core/config_loader.py,sha256=rStVRRUaeMGrMc44ocr0diMQQARZhbKqwMqQ6kqUNos,8722
|
30
30
|
signalwire_agents/core/contexts.py,sha256=g9FgOGMfGCUWlm57YZcv7CvOf-Ub9FdKZIOMu14ADfE,24428
|
@@ -35,7 +35,7 @@ signalwire_agents/core/pom_builder.py,sha256=ywuiIfP8BeLBPo_G4X1teZlG6zTCMkW71CZ
|
|
35
35
|
signalwire_agents/core/security_config.py,sha256=iAnAzKEJQiXL6mMpDaYm3Sjkxwm4x2N9HD6DeWSI8yI,12536
|
36
36
|
signalwire_agents/core/skill_base.py,sha256=1b_4ht_T1BVnfzHYqoILb3idrrPYMs5-G-adHo2IVss,6903
|
37
37
|
signalwire_agents/core/skill_manager.py,sha256=D4erpz0tmSYLqyfeteNNIY0VRWDtX0rDw3n7Z_f0W5U,10493
|
38
|
-
signalwire_agents/core/swaig_function.py,sha256=
|
38
|
+
signalwire_agents/core/swaig_function.py,sha256=Zf1RQOadBgV4oxXJY7n4IfueYu0dKinfjB5RkBoHbrI,7534
|
39
39
|
signalwire_agents/core/swml_builder.py,sha256=tJBFDAVTENEfjGLp2h9_AKOYt5O9FrSYLI-nZZVwM1E,15604
|
40
40
|
signalwire_agents/core/swml_handler.py,sha256=hFDq41dQWL3EdFbq6h0hizE1dIqdVeiTeCrujbZsPzo,8397
|
41
41
|
signalwire_agents/core/swml_renderer.py,sha256=-WAB_5ss836a8nBo5zlb6SaQKFNF4XIo1odWIXM4eE8,6860
|
@@ -51,7 +51,7 @@ signalwire_agents/core/agent/security/__init__.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_
|
|
51
51
|
signalwire_agents/core/agent/swml/__init__.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663YjFX_PumJ35Xds,191
|
52
52
|
signalwire_agents/core/agent/tools/__init__.py,sha256=eOcmyeGm6qogT3wsBx7QvdjmTbc1p5hnPR6uIlvTLxI,339
|
53
53
|
signalwire_agents/core/agent/tools/decorator.py,sha256=pC6j1114GwVBd2U3h23I9gKLtu8AgeiuWV0lUzz682U,2961
|
54
|
-
signalwire_agents/core/agent/tools/registry.py,sha256=
|
54
|
+
signalwire_agents/core/agent/tools/registry.py,sha256=HScbKKwpJqFZ_odmeFklSQ0p0EMasEyKSxNwX568OPo,8054
|
55
55
|
signalwire_agents/core/mixins/__init__.py,sha256=NsFpfF7TDP_lNR0Riw4Nbvt4fDbv_A3OoVbBqRrtXQM,652
|
56
56
|
signalwire_agents/core/mixins/ai_config_mixin.py,sha256=kT-xVVWMIE6RQe6qQFCRYxli345bxOs5uS1dCtMTeTc,18232
|
57
57
|
signalwire_agents/core/mixins/auth_mixin.py,sha256=Y9kR423-76U_pKL7KXzseeXX2a-4WxNWyo3odS7TDQM,9879
|
@@ -128,9 +128,9 @@ signalwire_agents/utils/token_generators.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663
|
|
128
128
|
signalwire_agents/utils/validators.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663YjFX_PumJ35Xds,191
|
129
129
|
signalwire_agents/web/__init__.py,sha256=XE_pSTY9Aalzr7J7wqFth1Zr3cccQHPPcF5HWNrOpz8,383
|
130
130
|
signalwire_agents/web/web_service.py,sha256=a2PSHJgX1tlZr0Iz1A1UouZjXEePJAZL632evvLVM38,21071
|
131
|
-
signalwire_agents-0.1.
|
132
|
-
signalwire_agents-0.1.
|
133
|
-
signalwire_agents-0.1.
|
134
|
-
signalwire_agents-0.1.
|
135
|
-
signalwire_agents-0.1.
|
136
|
-
signalwire_agents-0.1.
|
131
|
+
signalwire_agents-0.1.46.dist-info/licenses/LICENSE,sha256=NYvAsB-rTcSvG9cqHt9EUHAWLiA9YzM4Qfz-mPdvDR0,1067
|
132
|
+
signalwire_agents-0.1.46.dist-info/METADATA,sha256=8Ek6hbt3XtY4I_7nZj4LKk8qJL0KZogp6tOzmd-ioro,41281
|
133
|
+
signalwire_agents-0.1.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
134
|
+
signalwire_agents-0.1.46.dist-info/entry_points.txt,sha256=ZDT65zfTO_YyDzi_hwQbCxIhrUfu_t8RpNXMMXlUPWI,144
|
135
|
+
signalwire_agents-0.1.46.dist-info/top_level.txt,sha256=kDGS6ZYv84K9P5Kyg9_S8P_pbUXoHkso0On_DB5bbWc,18
|
136
|
+
signalwire_agents-0.1.46.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|