Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eppo_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def get_bandit_action_detail(
subject_key,
subject_attributes,
action_contexts,
bandit_data.model_data,
bandit_data.bandit_model_data,
)

# log bandit action
Expand All @@ -350,7 +350,7 @@ def get_bandit_action_detail(
"action": evaluation.action_key if evaluation else None,
"actionProbability": evaluation.action_weight if evaluation else None,
"optimalityGap": evaluation.optimality_gap if evaluation else None,
"modelVersion": bandit_data.model_version if evaluation else None,
"modelVersion": bandit_data.bandit_model_version if evaluation else None,
"timestamp": datetime.datetime.utcnow().isoformat(),
"subjectNumericAttributes": (
subject_attributes.numeric_attributes
Expand Down
7 changes: 4 additions & 3 deletions eppo_client/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from enum import Enum
from pydantic import Field
from typing import Dict, List, Optional

from eppo_client.base_model import SdkBaseModel
Expand Down Expand Up @@ -96,7 +97,7 @@ class BanditModelData(SdkBaseModel):

class BanditData(SdkBaseModel):
bandit_key: str
model_name: str
bandit_model_name: str = Field(alias="modelName")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

bandit_model_version: str = Field(alias="modelVersion")
bandit_model_data: BanditModelData = Field(alias="modelData")
updated_at: datetime
model_version: str
model_data: BanditModelData
2 changes: 1 addition & 1 deletion eppo_client/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.3.0"
__version__ = "3.4.0"
4 changes: 2 additions & 2 deletions test/client_bandit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def test_bandit_generic_test_cases(test_case):
flag,
subject["subjectKey"],
ContextAttributes(
numeric_attributes=subject["subjectAttributes"]["numeric_attributes"],
numeric_attributes=subject["subjectAttributes"]["numericAttributes"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

categorical_attributes=subject["subjectAttributes"][
"categorical_attributes"
"categoricalAttributes"
],
),
{
Expand Down