This repository was archived by the owner on Nov 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,7 @@ def get_bandit_action_detail(
339
339
subject_key ,
340
340
subject_attributes ,
341
341
action_contexts ,
342
- bandit_data .model_data ,
342
+ bandit_data .bandit_model_data ,
343
343
)
344
344
345
345
# log bandit action
@@ -350,7 +350,7 @@ def get_bandit_action_detail(
350
350
"action" : evaluation .action_key if evaluation else None ,
351
351
"actionProbability" : evaluation .action_weight if evaluation else None ,
352
352
"optimalityGap" : evaluation .optimality_gap if evaluation else None ,
353
- "modelVersion" : bandit_data .model_version if evaluation else None ,
353
+ "modelVersion" : bandit_data .bandit_model_version if evaluation else None ,
354
354
"timestamp" : datetime .datetime .utcnow ().isoformat (),
355
355
"subjectNumericAttributes" : (
356
356
subject_attributes .numeric_attributes
Original file line number Diff line number Diff line change 1
1
from datetime import datetime
2
2
from enum import Enum
3
+ from pydantic import Field
3
4
from typing import Dict , List , Optional
4
5
5
6
from eppo_client .base_model import SdkBaseModel
@@ -96,7 +97,7 @@ class BanditModelData(SdkBaseModel):
96
97
97
98
class BanditData (SdkBaseModel ):
98
99
bandit_key : str
99
- model_name : str
100
+ bandit_model_name : str = Field (alias = "modelName" )
101
+ bandit_model_version : str = Field (alias = "modelVersion" )
102
+ bandit_model_data : BanditModelData = Field (alias = "modelData" )
100
103
updated_at : datetime
101
- model_version : str
102
- model_data : BanditModelData
Original file line number Diff line number Diff line change 1
- __version__ = "3.3 .0"
1
+ __version__ = "3.4 .0"
Original file line number Diff line number Diff line change @@ -175,9 +175,9 @@ def test_bandit_generic_test_cases(test_case):
175
175
flag ,
176
176
subject ["subjectKey" ],
177
177
ContextAttributes (
178
- numeric_attributes = subject ["subjectAttributes" ]["numeric_attributes " ],
178
+ numeric_attributes = subject ["subjectAttributes" ]["numericAttributes " ],
179
179
categorical_attributes = subject ["subjectAttributes" ][
180
- "categorical_attributes "
180
+ "categoricalAttributes "
181
181
],
182
182
),
183
183
{
You can’t perform that action at this time.
0 commit comments