@@ -1219,17 +1219,21 @@ class MessageContextSkill():
12191219
12201220 :attr dict user_defined: (optional) Arbitrary variables that can be read and
12211221 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.
12231224 """
12241225
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 :
12271230 """
12281231 Initialize a MessageContextSkill object.
12291232
12301233 :param dict user_defined: (optional) Arbitrary variables that can be read
12311234 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.
12331237 """
12341238 self .user_defined = user_defined
12351239 self .system = system
@@ -1247,7 +1251,8 @@ def from_dict(cls, _dict: Dict) -> 'MessageContextSkill':
12471251 if 'user_defined' in _dict :
12481252 args ['user_defined' ] = _dict .get ('user_defined' )
12491253 if 'system' in _dict :
1250- args ['system' ] = _dict .get ('system' )
1254+ args ['system' ] = MessageContextSkillSystem ._from_dict (
1255+ _dict .get ('system' ))
12511256 return cls (** args )
12521257
12531258 @classmethod
@@ -1261,7 +1266,7 @@ def to_dict(self) -> Dict:
12611266 if hasattr (self , 'user_defined' ) and self .user_defined is not None :
12621267 _dict ['user_defined' ] = self .user_defined
12631268 if hasattr (self , 'system' ) and self .system is not None :
1264- _dict ['system' ] = self .system
1269+ _dict ['system' ] = self .system . _to_dict ()
12651270 return _dict
12661271
12671272 def _to_dict (self ):
@@ -1283,6 +1288,89 @@ def __ne__(self, other: 'MessageContextSkill') -> bool:
12831288 return not self == other
12841289
12851290
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+
12861374class MessageContextSkills ():
12871375 """
12881376 Information specific to particular skills used by the Assistant.
@@ -1488,49 +1576,68 @@ class MessageInputOptions():
14881576 Optional properties that control how the assistant responds.
14891577
14901578 :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.
14931582 :attr bool restart: (optional) Whether to restart dialog processing at the root
14941583 of the dialog, regardless of any previously visited nodes. **Note:** This does
14951584 not affect `turn_count` or any other context variables.
14961585 :attr bool alternate_intents: (optional) Whether to return more than one intent.
14971586 Set to `true` to return all matching intents.
14981587 :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**.
15011596 """
15021597
15031598 def __init__ (self ,
15041599 * ,
15051600 debug : bool = None ,
15061601 restart : bool = None ,
15071602 alternate_intents : bool = None ,
1508- return_context : bool = None ) -> None :
1603+ return_context : bool = None ,
1604+ export : bool = None ) -> None :
15091605 """
15101606 Initialize a MessageInputOptions object.
15111607
15121608 :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.
15151612 :param bool restart: (optional) Whether to restart dialog processing at the
15161613 root of the dialog, regardless of any previously visited nodes. **Note:**
15171614 This does not affect `turn_count` or any other context variables.
15181615 :param bool alternate_intents: (optional) Whether to return more than one
15191616 intent. Set to `true` to return all matching intents.
15201617 :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**.
15231627 """
15241628 self .debug = debug
15251629 self .restart = restart
15261630 self .alternate_intents = alternate_intents
15271631 self .return_context = return_context
1632+ self .export = export
15281633
15291634 @classmethod
15301635 def from_dict (cls , _dict : Dict ) -> 'MessageInputOptions' :
15311636 """Initialize a MessageInputOptions object from a json dictionary."""
15321637 args = {}
1533- valid_keys = ['debug' , 'restart' , 'alternate_intents' , 'return_context' ]
1638+ valid_keys = [
1639+ 'debug' , 'restart' , 'alternate_intents' , 'return_context' , 'export'
1640+ ]
15341641 bad_keys = set (_dict .keys ()) - set (valid_keys )
15351642 if bad_keys :
15361643 raise ValueError (
@@ -1544,6 +1651,8 @@ def from_dict(cls, _dict: Dict) -> 'MessageInputOptions':
15441651 args ['alternate_intents' ] = _dict .get ('alternate_intents' )
15451652 if 'return_context' in _dict :
15461653 args ['return_context' ] = _dict .get ('return_context' )
1654+ if 'export' in _dict :
1655+ args ['export' ] = _dict .get ('export' )
15471656 return cls (** args )
15481657
15491658 @classmethod
@@ -1563,6 +1672,8 @@ def to_dict(self) -> Dict:
15631672 _dict ['alternate_intents' ] = self .alternate_intents
15641673 if hasattr (self , 'return_context' ) and self .return_context is not None :
15651674 _dict ['return_context' ] = self .return_context
1675+ if hasattr (self , 'export' ) and self .export is not None :
1676+ _dict ['export' ] = self .export
15661677 return _dict
15671678
15681679 def _to_dict (self ):
@@ -1836,8 +1947,8 @@ class MessageResponse():
18361947
18371948 :attr MessageOutput output: Assistant output to be rendered or processed by the
18381949 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
18411952 property to access context variables.
18421953 **Note:** The context is included in message responses only if
18431954 **return_context**=`true` in the message request.
@@ -1852,7 +1963,7 @@ def __init__(self,
18521963
18531964 :param MessageOutput output: Assistant output to be rendered or processed
18541965 by the client.
1855- :param MessageContext context: (optional) State information for the
1966+ :param MessageContext context: (optional) Context data for the
18561967 conversation. The context is stored by the assistant on a per-session
18571968 basis. You can use this property to access context variables.
18581969 **Note:** The context is included in message responses only if
@@ -3191,7 +3302,9 @@ class SearchResultMetadata():
31913302 indicates a greater match to the query parameters.
31923303 """
31933304
3194- def __init__ (self , * , confidence : float = None ,
3305+ def __init__ (self ,
3306+ * ,
3307+ confidence : float = None ,
31953308 score : float = None ) -> None :
31963309 """
31973310 Initialize a SearchResultMetadata object.
0 commit comments