@@ -1219,17 +1219,21 @@ class MessageContextSkill():
1219
1219
1220
1220
:attr dict user_defined: (optional) Arbitrary variables that can be read and
1221
1221
written by a particular skill.
1222
- :attr dict system: (optional) For internal use only.
1222
+ :attr MessageContextSkillSystem system: (optional) System context data used by
1223
+ the skill.
1223
1224
"""
1224
1225
1225
- def __init__ (self , * , user_defined : dict = None ,
1226
- system : dict = None ) -> None :
1226
+ def __init__ (self ,
1227
+ * ,
1228
+ user_defined : dict = None ,
1229
+ system : 'MessageContextSkillSystem' = None ) -> None :
1227
1230
"""
1228
1231
Initialize a MessageContextSkill object.
1229
1232
1230
1233
:param dict user_defined: (optional) Arbitrary variables that can be read
1231
1234
and written by a particular skill.
1232
- :param dict system: (optional) For internal use only.
1235
+ :param MessageContextSkillSystem system: (optional) System context data
1236
+ used by the skill.
1233
1237
"""
1234
1238
self .user_defined = user_defined
1235
1239
self .system = system
@@ -1247,7 +1251,8 @@ def from_dict(cls, _dict: Dict) -> 'MessageContextSkill':
1247
1251
if 'user_defined' in _dict :
1248
1252
args ['user_defined' ] = _dict .get ('user_defined' )
1249
1253
if 'system' in _dict :
1250
- args ['system' ] = _dict .get ('system' )
1254
+ args ['system' ] = MessageContextSkillSystem ._from_dict (
1255
+ _dict .get ('system' ))
1251
1256
return cls (** args )
1252
1257
1253
1258
@classmethod
@@ -1261,7 +1266,7 @@ def to_dict(self) -> Dict:
1261
1266
if hasattr (self , 'user_defined' ) and self .user_defined is not None :
1262
1267
_dict ['user_defined' ] = self .user_defined
1263
1268
if hasattr (self , 'system' ) and self .system is not None :
1264
- _dict ['system' ] = self .system
1269
+ _dict ['system' ] = self .system . _to_dict ()
1265
1270
return _dict
1266
1271
1267
1272
def _to_dict (self ):
@@ -1283,6 +1288,89 @@ def __ne__(self, other: 'MessageContextSkill') -> bool:
1283
1288
return not self == other
1284
1289
1285
1290
1291
+ class MessageContextSkillSystem ():
1292
+ """
1293
+ System context data used by the skill.
1294
+
1295
+ :attr str state: (optional) An encoded string representing the current
1296
+ conversation state. By saving this value and then sending it in the context of a
1297
+ subsequent message request, you can restore the conversation to the same state.
1298
+ This can be useful if you need to return to an earlier point in the conversation
1299
+ or resume a paused conversation after the session has expired.
1300
+ """
1301
+
1302
+ def __init__ (self , * , state : str = None , ** kwargs ) -> None :
1303
+ """
1304
+ Initialize a MessageContextSkillSystem object.
1305
+
1306
+ :param str state: (optional) An encoded string representing the current
1307
+ conversation state. By saving this value and then sending it in the context
1308
+ of a subsequent message request, you can restore the conversation to the
1309
+ same state. This can be useful if you need to return to an earlier point in
1310
+ the conversation or resume a paused conversation after the session has
1311
+ expired.
1312
+ :param **kwargs: (optional) Any additional properties.
1313
+ """
1314
+ self .state = state
1315
+ for _key , _value in kwargs .items ():
1316
+ setattr (self , _key , _value )
1317
+
1318
+ @classmethod
1319
+ def from_dict (cls , _dict : Dict ) -> 'MessageContextSkillSystem' :
1320
+ """Initialize a MessageContextSkillSystem object from a json dictionary."""
1321
+ args = {}
1322
+ xtra = _dict .copy ()
1323
+ if 'state' in _dict :
1324
+ args ['state' ] = _dict .get ('state' )
1325
+ del xtra ['state' ]
1326
+ args .update (xtra )
1327
+ return cls (** args )
1328
+
1329
+ @classmethod
1330
+ def _from_dict (cls , _dict ):
1331
+ """Initialize a MessageContextSkillSystem object from a json dictionary."""
1332
+ return cls .from_dict (_dict )
1333
+
1334
+ def to_dict (self ) -> Dict :
1335
+ """Return a json dictionary representing this model."""
1336
+ _dict = {}
1337
+ if hasattr (self , 'state' ) and self .state is not None :
1338
+ _dict ['state' ] = self .state
1339
+ if hasattr (self , '_additionalProperties' ):
1340
+ for _key in self ._additionalProperties :
1341
+ _value = getattr (self , _key , None )
1342
+ if _value is not None :
1343
+ _dict [_key ] = _value
1344
+ return _dict
1345
+
1346
+ def _to_dict (self ):
1347
+ """Return a json dictionary representing this model."""
1348
+ return self .to_dict ()
1349
+
1350
+ def __setattr__ (self , name : str , value : object ) -> None :
1351
+ properties = {'state' }
1352
+ if not hasattr (self , '_additionalProperties' ):
1353
+ super (MessageContextSkillSystem ,
1354
+ self ).__setattr__ ('_additionalProperties' , set ())
1355
+ if name not in properties :
1356
+ self ._additionalProperties .add (name )
1357
+ super (MessageContextSkillSystem , self ).__setattr__ (name , value )
1358
+
1359
+ def __str__ (self ) -> str :
1360
+ """Return a `str` version of this MessageContextSkillSystem object."""
1361
+ return json .dumps (self ._to_dict (), indent = 2 )
1362
+
1363
+ def __eq__ (self , other : 'MessageContextSkillSystem' ) -> bool :
1364
+ """Return `true` when self and other are equal, false otherwise."""
1365
+ if not isinstance (other , self .__class__ ):
1366
+ return False
1367
+ return self .__dict__ == other .__dict__
1368
+
1369
+ def __ne__ (self , other : 'MessageContextSkillSystem' ) -> bool :
1370
+ """Return `true` when self and other are not equal, false otherwise."""
1371
+ return not self == other
1372
+
1373
+
1286
1374
class MessageContextSkills ():
1287
1375
"""
1288
1376
Information specific to particular skills used by the Assistant.
@@ -1488,49 +1576,68 @@ class MessageInputOptions():
1488
1576
Optional properties that control how the assistant responds.
1489
1577
1490
1578
:attr bool debug: (optional) Whether to return additional diagnostic
1491
- information. Set to `true` to return additional information under the
1492
- `output.debug` key.
1579
+ information. Set to `true` to return additional information in the
1580
+ `output.debug` property. If you also specify **return_context**=`true`, the
1581
+ returned skill context includes the `system.state` property.
1493
1582
:attr bool restart: (optional) Whether to restart dialog processing at the root
1494
1583
of the dialog, regardless of any previously visited nodes. **Note:** This does
1495
1584
not affect `turn_count` or any other context variables.
1496
1585
:attr bool alternate_intents: (optional) Whether to return more than one intent.
1497
1586
Set to `true` to return all matching intents.
1498
1587
:attr bool return_context: (optional) Whether to return session context with the
1499
- response. If you specify `true`, the response will include the `context`
1500
- property.
1588
+ response. If you specify `true`, the response includes the `context` property.
1589
+ If you also specify **debug**=`true`, the returned skill context includes the
1590
+ `system.state` property.
1591
+ :attr bool export: (optional) Whether to return session context, including full
1592
+ conversation state. If you specify `true`, the response includes the `context`
1593
+ property, and the skill context includes the `system.state` property.
1594
+ **Note:** If **export**=`true`, the context is returned regardless of the value
1595
+ of **return_context**.
1501
1596
"""
1502
1597
1503
1598
def __init__ (self ,
1504
1599
* ,
1505
1600
debug : bool = None ,
1506
1601
restart : bool = None ,
1507
1602
alternate_intents : bool = None ,
1508
- return_context : bool = None ) -> None :
1603
+ return_context : bool = None ,
1604
+ export : bool = None ) -> None :
1509
1605
"""
1510
1606
Initialize a MessageInputOptions object.
1511
1607
1512
1608
:param bool debug: (optional) Whether to return additional diagnostic
1513
- information. Set to `true` to return additional information under the
1514
- `output.debug` key.
1609
+ information. Set to `true` to return additional information in the
1610
+ `output.debug` property. If you also specify **return_context**=`true`, the
1611
+ returned skill context includes the `system.state` property.
1515
1612
:param bool restart: (optional) Whether to restart dialog processing at the
1516
1613
root of the dialog, regardless of any previously visited nodes. **Note:**
1517
1614
This does not affect `turn_count` or any other context variables.
1518
1615
:param bool alternate_intents: (optional) Whether to return more than one
1519
1616
intent. Set to `true` to return all matching intents.
1520
1617
:param bool return_context: (optional) Whether to return session context
1521
- with the response. If you specify `true`, the response will include the
1522
- `context` property.
1618
+ with the response. If you specify `true`, the response includes the
1619
+ `context` property. If you also specify **debug**=`true`, the returned
1620
+ skill context includes the `system.state` property.
1621
+ :param bool export: (optional) Whether to return session context, including
1622
+ full conversation state. If you specify `true`, the response includes the
1623
+ `context` property, and the skill context includes the `system.state`
1624
+ property.
1625
+ **Note:** If **export**=`true`, the context is returned regardless of the
1626
+ value of **return_context**.
1523
1627
"""
1524
1628
self .debug = debug
1525
1629
self .restart = restart
1526
1630
self .alternate_intents = alternate_intents
1527
1631
self .return_context = return_context
1632
+ self .export = export
1528
1633
1529
1634
@classmethod
1530
1635
def from_dict (cls , _dict : Dict ) -> 'MessageInputOptions' :
1531
1636
"""Initialize a MessageInputOptions object from a json dictionary."""
1532
1637
args = {}
1533
- valid_keys = ['debug' , 'restart' , 'alternate_intents' , 'return_context' ]
1638
+ valid_keys = [
1639
+ 'debug' , 'restart' , 'alternate_intents' , 'return_context' , 'export'
1640
+ ]
1534
1641
bad_keys = set (_dict .keys ()) - set (valid_keys )
1535
1642
if bad_keys :
1536
1643
raise ValueError (
@@ -1544,6 +1651,8 @@ def from_dict(cls, _dict: Dict) -> 'MessageInputOptions':
1544
1651
args ['alternate_intents' ] = _dict .get ('alternate_intents' )
1545
1652
if 'return_context' in _dict :
1546
1653
args ['return_context' ] = _dict .get ('return_context' )
1654
+ if 'export' in _dict :
1655
+ args ['export' ] = _dict .get ('export' )
1547
1656
return cls (** args )
1548
1657
1549
1658
@classmethod
@@ -1563,6 +1672,8 @@ def to_dict(self) -> Dict:
1563
1672
_dict ['alternate_intents' ] = self .alternate_intents
1564
1673
if hasattr (self , 'return_context' ) and self .return_context is not None :
1565
1674
_dict ['return_context' ] = self .return_context
1675
+ if hasattr (self , 'export' ) and self .export is not None :
1676
+ _dict ['export' ] = self .export
1566
1677
return _dict
1567
1678
1568
1679
def _to_dict (self ):
@@ -1836,8 +1947,8 @@ class MessageResponse():
1836
1947
1837
1948
:attr MessageOutput output: Assistant output to be rendered or processed by the
1838
1949
client.
1839
- :attr MessageContext context: (optional) State information for the conversation.
1840
- The context is stored by the assistant on a per-session basis. You can use this
1950
+ :attr MessageContext context: (optional) Context data for the conversation. The
1951
+ context is stored by the assistant on a per-session basis. You can use this
1841
1952
property to access context variables.
1842
1953
**Note:** The context is included in message responses only if
1843
1954
**return_context**=`true` in the message request.
@@ -1852,7 +1963,7 @@ def __init__(self,
1852
1963
1853
1964
:param MessageOutput output: Assistant output to be rendered or processed
1854
1965
by the client.
1855
- :param MessageContext context: (optional) State information for the
1966
+ :param MessageContext context: (optional) Context data for the
1856
1967
conversation. The context is stored by the assistant on a per-session
1857
1968
basis. You can use this property to access context variables.
1858
1969
**Note:** The context is included in message responses only if
@@ -3191,7 +3302,9 @@ class SearchResultMetadata():
3191
3302
indicates a greater match to the query parameters.
3192
3303
"""
3193
3304
3194
- def __init__ (self , * , confidence : float = None ,
3305
+ def __init__ (self ,
3306
+ * ,
3307
+ confidence : float = None ,
3195
3308
score : float = None ) -> None :
3196
3309
"""
3197
3310
Initialize a SearchResultMetadata object.
0 commit comments