@@ -1059,13 +1059,31 @@ class MessageContextGlobalSystem():
1059
1059
with each turn of the conversation. A value of 1 indicates that this is the the
1060
1060
first turn of a new conversation, which can affect the behavior of some skills
1061
1061
(for example, triggering the start node of a dialog).
1062
+ :attr str locale: (optional) The language code for localization in the user
1063
+ input. The specified locale overrides the default for the assistant, and is used
1064
+ for interpreting entity values in user input such as date values. For example,
1065
+ `04/03/2018` might be interpreted either as April 3 or March 4, depending on the
1066
+ locale.
1067
+ This property is included only if the new system entities are enabled for the
1068
+ skill.
1069
+ :attr str reference_time: (optional) The base time for interpreting any relative
1070
+ time mentions in the user input. The specified time overrides the current server
1071
+ time, and is used to calculate times mentioned in relative terms such as `now`
1072
+ or `tomorrow`. This can be useful for simulating past or future times for
1073
+ testing purposes, or when analyzing documents such as news articles.
1074
+ This value must be a UTC time value formatted according to ISO 8601 (for
1075
+ example, `2019-06-26T12:00:00Z` for noon on 26 June 2019.
1076
+ This property is included only if the new system entities are enabled for the
1077
+ skill.
1062
1078
"""
1063
1079
1064
1080
def __init__ (self ,
1065
1081
* ,
1066
1082
timezone : str = None ,
1067
1083
user_id : str = None ,
1068
- turn_count : int = None ) -> None :
1084
+ turn_count : int = None ,
1085
+ locale : str = None ,
1086
+ reference_time : str = None ) -> None :
1069
1087
"""
1070
1088
Initialize a MessageContextGlobalSystem object.
1071
1089
@@ -1082,16 +1100,37 @@ def __init__(self,
1082
1100
this is the the first turn of a new conversation, which can affect the
1083
1101
behavior of some skills (for example, triggering the start node of a
1084
1102
dialog).
1103
+ :param str locale: (optional) The language code for localization in the
1104
+ user input. The specified locale overrides the default for the assistant,
1105
+ and is used for interpreting entity values in user input such as date
1106
+ values. For example, `04/03/2018` might be interpreted either as April 3 or
1107
+ March 4, depending on the locale.
1108
+ This property is included only if the new system entities are enabled for
1109
+ the skill.
1110
+ :param str reference_time: (optional) The base time for interpreting any
1111
+ relative time mentions in the user input. The specified time overrides the
1112
+ current server time, and is used to calculate times mentioned in relative
1113
+ terms such as `now` or `tomorrow`. This can be useful for simulating past
1114
+ or future times for testing purposes, or when analyzing documents such as
1115
+ news articles.
1116
+ This value must be a UTC time value formatted according to ISO 8601 (for
1117
+ example, `2019-06-26T12:00:00Z` for noon on 26 June 2019.
1118
+ This property is included only if the new system entities are enabled for
1119
+ the skill.
1085
1120
"""
1086
1121
self .timezone = timezone
1087
1122
self .user_id = user_id
1088
1123
self .turn_count = turn_count
1124
+ self .locale = locale
1125
+ self .reference_time = reference_time
1089
1126
1090
1127
@classmethod
1091
1128
def from_dict (cls , _dict : Dict ) -> 'MessageContextGlobalSystem' :
1092
1129
"""Initialize a MessageContextGlobalSystem object from a json dictionary."""
1093
1130
args = {}
1094
- valid_keys = ['timezone' , 'user_id' , 'turn_count' ]
1131
+ valid_keys = [
1132
+ 'timezone' , 'user_id' , 'turn_count' , 'locale' , 'reference_time'
1133
+ ]
1095
1134
bad_keys = set (_dict .keys ()) - set (valid_keys )
1096
1135
if bad_keys :
1097
1136
raise ValueError (
@@ -1103,6 +1142,10 @@ def from_dict(cls, _dict: Dict) -> 'MessageContextGlobalSystem':
1103
1142
args ['user_id' ] = _dict .get ('user_id' )
1104
1143
if 'turn_count' in _dict :
1105
1144
args ['turn_count' ] = _dict .get ('turn_count' )
1145
+ if 'locale' in _dict :
1146
+ args ['locale' ] = _dict .get ('locale' )
1147
+ if 'reference_time' in _dict :
1148
+ args ['reference_time' ] = _dict .get ('reference_time' )
1106
1149
return cls (** args )
1107
1150
1108
1151
@classmethod
@@ -1119,6 +1162,10 @@ def to_dict(self) -> Dict:
1119
1162
_dict ['user_id' ] = self .user_id
1120
1163
if hasattr (self , 'turn_count' ) and self .turn_count is not None :
1121
1164
_dict ['turn_count' ] = self .turn_count
1165
+ if hasattr (self , 'locale' ) and self .locale is not None :
1166
+ _dict ['locale' ] = self .locale
1167
+ if hasattr (self , 'reference_time' ) and self .reference_time is not None :
1168
+ _dict ['reference_time' ] = self .reference_time
1122
1169
return _dict
1123
1170
1124
1171
def _to_dict (self ):
0 commit comments