signalwire-agents 0.1.12__py3-none-any.whl → 0.1.13__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_base.py +0 -2
- signalwire_agents/core/swaig_function.py +2 -3
- signalwire_agents/core/swml_renderer.py +43 -28
- {signalwire_agents-0.1.12.dist-info → signalwire_agents-0.1.13.dist-info}/METADATA +1 -1
- {signalwire_agents-0.1.12.dist-info → signalwire_agents-0.1.13.dist-info}/RECORD +11 -11
- {signalwire_agents-0.1.12.data → signalwire_agents-0.1.13.data}/data/schema.json +0 -0
- {signalwire_agents-0.1.12.dist-info → signalwire_agents-0.1.13.dist-info}/WHEEL +0 -0
- {signalwire_agents-0.1.12.dist-info → signalwire_agents-0.1.13.dist-info}/entry_points.txt +0 -0
- {signalwire_agents-0.1.12.dist-info → signalwire_agents-0.1.13.dist-info}/licenses/LICENSE +0 -0
- {signalwire_agents-0.1.12.dist-info → signalwire_agents-0.1.13.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.13"
|
22
22
|
|
23
23
|
# Import core classes for easier access
|
24
24
|
from .core.agent_base import AgentBase
|
@@ -2227,8 +2227,6 @@ class AgentBase(SWMLService):
|
|
2227
2227
|
|
2228
2228
|
self.log.info("callback_endpoint_registered", path=callback_path)
|
2229
2229
|
|
2230
|
-
@classmethod
|
2231
|
-
|
2232
2230
|
# ----------------------------------------------------------------------
|
2233
2231
|
# AI Verb Configuration Methods
|
2234
2232
|
# ----------------------------------------------------------------------
|
@@ -15,6 +15,8 @@ from typing import Dict, Any, Optional, Callable, List, Type, Union
|
|
15
15
|
import inspect
|
16
16
|
import logging
|
17
17
|
|
18
|
+
# Import here to avoid circular imports
|
19
|
+
from signalwire_agents.core.function_result import SwaigFunctionResult
|
18
20
|
|
19
21
|
class SWAIGFunction:
|
20
22
|
"""
|
@@ -101,9 +103,6 @@ class SWAIGFunction:
|
|
101
103
|
# Call the handler with both args and raw_data
|
102
104
|
result = self.handler(args, raw_data)
|
103
105
|
|
104
|
-
# Import here to avoid circular imports
|
105
|
-
from signalwire_agents.core.function_result import SwaigFunctionResult
|
106
|
-
|
107
106
|
# Handle different result types - everything must end up as a SwaigFunctionResult
|
108
107
|
if isinstance(result, SwaigFunctionResult):
|
109
108
|
# Already a SwaigFunctionResult - just convert to dict
|
@@ -269,6 +269,7 @@ class SwmlRenderer:
|
|
269
269
|
|
270
270
|
# Return in requested format
|
271
271
|
if format.lower() == "yaml":
|
272
|
+
import yaml
|
272
273
|
return yaml.dump(swml, sort_keys=False)
|
273
274
|
else:
|
274
275
|
return json.dumps(swml, indent=2)
|
@@ -305,17 +306,24 @@ class SwmlRenderer:
|
|
305
306
|
# Add any actions
|
306
307
|
if actions:
|
307
308
|
for action in actions:
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
]
|
316
|
-
|
317
|
-
|
318
|
-
|
309
|
+
# Support both type-based actions and direct SWML verbs
|
310
|
+
if "type" in action:
|
311
|
+
# Type-based action format
|
312
|
+
if action["type"] == "play":
|
313
|
+
service.add_verb("play", {
|
314
|
+
"url": action["url"]
|
315
|
+
})
|
316
|
+
elif action["type"] == "transfer":
|
317
|
+
service.add_verb("connect", [
|
318
|
+
{"to": action["dest"]}
|
319
|
+
])
|
320
|
+
elif action["type"] == "hang_up":
|
321
|
+
service.add_verb("hangup", {})
|
322
|
+
# Additional action types could be added here
|
323
|
+
else:
|
324
|
+
# Direct SWML verb format
|
325
|
+
for verb_name, verb_config in action.items():
|
326
|
+
service.add_verb(verb_name, verb_config)
|
319
327
|
|
320
328
|
# Return in requested format
|
321
329
|
if format.lower() == "yaml":
|
@@ -343,26 +351,33 @@ class SwmlRenderer:
|
|
343
351
|
# Add any actions
|
344
352
|
if actions:
|
345
353
|
for action in actions:
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
]
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
354
|
+
# Support both type-based actions and direct SWML verbs
|
355
|
+
if "type" in action:
|
356
|
+
# Type-based action format
|
357
|
+
if action["type"] == "play":
|
358
|
+
swml["sections"]["main"].append({
|
359
|
+
"play": {
|
360
|
+
"url": action["url"]
|
361
|
+
}
|
362
|
+
})
|
363
|
+
elif action["type"] == "transfer":
|
364
|
+
swml["sections"]["main"].append({
|
365
|
+
"connect": [
|
366
|
+
{"to": action["dest"]}
|
367
|
+
]
|
368
|
+
})
|
369
|
+
elif action["type"] == "hang_up":
|
370
|
+
swml["sections"]["main"].append({
|
371
|
+
"hangup": {}
|
372
|
+
})
|
373
|
+
# Additional action types could be added here
|
374
|
+
else:
|
375
|
+
# Direct SWML verb format - add the action as-is
|
376
|
+
swml["sections"]["main"].append(action)
|
363
377
|
|
364
378
|
# Return in requested format
|
365
379
|
if format.lower() == "yaml":
|
380
|
+
import yaml
|
366
381
|
return yaml.dump(swml, sort_keys=False)
|
367
382
|
else:
|
368
383
|
return json.dumps(swml)
|
@@ -1,11 +1,11 @@
|
|
1
|
-
signalwire_agents/__init__.py,sha256=
|
1
|
+
signalwire_agents/__init__.py,sha256=IY7WpXHkFSNDItkEDkJpsfz3a4Bsw5aotPRtrHqJne4,2093
|
2
2
|
signalwire_agents/agent_server.py,sha256=3Or8rIMAqW750V-XitBUMgOpW9BAIXmKXoGq7LkejAA,24988
|
3
3
|
signalwire_agents/schema.json,sha256=M8Mn6pQda2P9jhbmkALrLr1wt-fRuhYRqdmEi9Rbhqk,178075
|
4
4
|
signalwire_agents/cli/__init__.py,sha256=Iy2BfWDWBEZoA1cyHTDsooBSVMx4vH5Ddhr3sEuFe8c,197
|
5
5
|
signalwire_agents/cli/build_search.py,sha256=FXEgZEDn_2-7sJGQ07LYUxT9MGySUN-kpUbCCPBYxWk,15966
|
6
6
|
signalwire_agents/cli/test_swaig.py,sha256=tBl2r-MqxKDiAVMfaDOntR9OMFE3I0ff51oGMlRQsl8,100237
|
7
7
|
signalwire_agents/core/__init__.py,sha256=mVDLbpq1pg_WwiqsQR28NNZwJ6-VUXFIfg-vN7pk0ew,806
|
8
|
-
signalwire_agents/core/agent_base.py,sha256=
|
8
|
+
signalwire_agents/core/agent_base.py,sha256=uZoHeSivokoBL67CiseKur4L9JCq0Pzu-BDZ9hiNOYE,141686
|
9
9
|
signalwire_agents/core/contexts.py,sha256=h7hra4xoiKAUdVyJhcKggl8X9EoqwTVWBmNMp-sEsuc,9598
|
10
10
|
signalwire_agents/core/data_map.py,sha256=U-HLEZQomWf-UI0-nLAE8g1oyRdE5bU_WxQpboI2YI4,17695
|
11
11
|
signalwire_agents/core/function_result.py,sha256=SP46vPAliEzwh3JeeSxmLD_f7_ixRxMBtpSl3t7jieU,45370
|
@@ -13,10 +13,10 @@ signalwire_agents/core/logging_config.py,sha256=ATO_Zo8Kc6Ts1wU39ewliF_dKAy6M91I
|
|
13
13
|
signalwire_agents/core/pom_builder.py,sha256=ywuiIfP8BeLBPo_G4X1teZlG6zTCMkW71CZnmyoDTAQ,6636
|
14
14
|
signalwire_agents/core/skill_base.py,sha256=lOpVTLhD9NjStF7Lxh6bAQUGa3DpNYV4agXJRakRuX0,4258
|
15
15
|
signalwire_agents/core/skill_manager.py,sha256=6vAzkWYeycilX-5T1B039sf8s11BfRh6ASstt70wWsw,8074
|
16
|
-
signalwire_agents/core/swaig_function.py,sha256=
|
16
|
+
signalwire_agents/core/swaig_function.py,sha256=3xJrrQVxCZX-DssLkdjaui_psTUzahkzAsQ1EyRVMFk,6837
|
17
17
|
signalwire_agents/core/swml_builder.py,sha256=Q1ikU9pedgjW888mjbqDFv-jMDvDZ-tZgfyMfu4qQN0,6719
|
18
18
|
signalwire_agents/core/swml_handler.py,sha256=C8NvMpNdFg9UiEzPwMmMXMn8X6w10IShKjBJ8VSITBk,8189
|
19
|
-
signalwire_agents/core/swml_renderer.py,sha256=
|
19
|
+
signalwire_agents/core/swml_renderer.py,sha256=u6HnbOC0NUnPpr6uz0FkXNEqcTF2OjWDui6gceD1Bhs,14773
|
20
20
|
signalwire_agents/core/swml_service.py,sha256=3yhYfowgdKphjf2OLJYuaPsE6Paewe6rAO3e7F7NPic,49797
|
21
21
|
signalwire_agents/core/security/__init__.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663YjFX_PumJ35Xds,191
|
22
22
|
signalwire_agents/core/security/session_manager.py,sha256=s5hXYcFnrsYFoyo-zcN7EJy-wInZQI_cWTBHX9MxHR4,9164
|
@@ -58,10 +58,10 @@ signalwire_agents/utils/pom_utils.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663YjFX_Pu
|
|
58
58
|
signalwire_agents/utils/schema_utils.py,sha256=i4okv_O9bUApwT_jJf4Yoij3bLCrGrW3DC-vzSy2RuY,16392
|
59
59
|
signalwire_agents/utils/token_generators.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663YjFX_PumJ35Xds,191
|
60
60
|
signalwire_agents/utils/validators.py,sha256=4Mr7baQ_xR_hfJ72YxQRAT_GFa663YjFX_PumJ35Xds,191
|
61
|
-
signalwire_agents-0.1.
|
62
|
-
signalwire_agents-0.1.
|
63
|
-
signalwire_agents-0.1.
|
64
|
-
signalwire_agents-0.1.
|
65
|
-
signalwire_agents-0.1.
|
66
|
-
signalwire_agents-0.1.
|
67
|
-
signalwire_agents-0.1.
|
61
|
+
signalwire_agents-0.1.13.data/data/schema.json,sha256=M8Mn6pQda2P9jhbmkALrLr1wt-fRuhYRqdmEi9Rbhqk,178075
|
62
|
+
signalwire_agents-0.1.13.dist-info/licenses/LICENSE,sha256=NYvAsB-rTcSvG9cqHt9EUHAWLiA9YzM4Qfz-mPdvDR0,1067
|
63
|
+
signalwire_agents-0.1.13.dist-info/METADATA,sha256=wdck4xWPqwblSSKcHWW52H7HIGta1R9-8_H4IlRzo0k,34572
|
64
|
+
signalwire_agents-0.1.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
65
|
+
signalwire_agents-0.1.13.dist-info/entry_points.txt,sha256=7RBxC9wwFdsqP7g1F4JzsJ3AIHsjGtb3h0mxEGmANlI,151
|
66
|
+
signalwire_agents-0.1.13.dist-info/top_level.txt,sha256=kDGS6ZYv84K9P5Kyg9_S8P_pbUXoHkso0On_DB5bbWc,18
|
67
|
+
signalwire_agents-0.1.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|