@@ -21,13 +21,15 @@ class ModelConfig:
21
21
Configuration related to the model.
22
22
"""
23
23
24
- def __init__ (self , id : str , parameters : Optional [Dict [str , Any ]] = None ):
24
+ def __init__ (self , id : str , parameters : Optional [Dict [str , Any ]] = None , custom : Optional [ Dict [ str , Any ]] = None ):
25
25
"""
26
26
:param id: The ID of the model.
27
27
:param parameters: Additional model-specific parameters.
28
+ :param custom: Additional customer provided data.
28
29
"""
29
30
self ._id = id
30
31
self ._parameters = parameters
32
+ self ._custom = custom
31
33
32
34
@property
33
35
def id (self ) -> str :
@@ -51,6 +53,15 @@ def get_parameter(self, key: str) -> Any:
51
53
52
54
return self ._parameters .get (key )
53
55
56
+ def get_custom (self , key : str ) -> Any :
57
+ """
58
+ Retrieve customer provided data.
59
+ """
60
+ if self ._custom is None :
61
+ return None
62
+
63
+ return self ._custom .get (key )
64
+
54
65
55
66
class ProviderConfig :
56
67
"""
@@ -128,9 +139,11 @@ def config(
128
139
model = None
129
140
if 'model' in variation and isinstance (variation ['model' ], dict ):
130
141
parameters = variation ['model' ].get ('parameters' , None )
142
+ custom = variation ['model' ].get ('custom' , None )
131
143
model = ModelConfig (
132
144
id = variation ['model' ]['id' ],
133
- parameters = parameters
145
+ parameters = parameters ,
146
+ custom = custom
134
147
)
135
148
136
149
enabled = variation .get ('_ldMeta' , {}).get ('enabled' , False )
0 commit comments