Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
leoromanovsky committed Dec 17, 2024
1 parent 1fa655b commit d785d7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion package-testing/python-sdk-relay/src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def handle_bandit():
numeric_attributes=request_obj.subject_attributes.get('numericAttributes', {}),
categorical_attributes=request_obj.subject_attributes.get('categoricalAttributes', {})
)
print(f"Subject context: {subject_context}")

# Create actions dictionary using ContextAttributes constructor
actions = {}
Expand All @@ -148,15 +149,18 @@ def handle_bandit():
numeric_attributes=action.get('numericAttributes', {}),
categorical_attributes=action.get('categoricalAttributes', {})
)
print(f"Actions: {actions}")

client = eppo_client.get_instance()
print(f"Calling get_bandit_action with flag={request_obj.flag}, subject_key={request_obj.subject_key}, default_value={request_obj.default_value}")
result = client.get_bandit_action(
request_obj.flag,
request_obj.subject_key,
subject_context,
actions,
request_obj.default_value
)
print(f"Raw result from get_bandit_action: {result}")

response = {
"result": {
Expand All @@ -167,7 +171,7 @@ def handle_bandit():
"banditLog": [],
"error": None
}
print(f"response: {response}")
print(f"Final response: {response}")
return jsonify(response)

except Exception as e:
Expand Down

0 comments on commit d785d7a

Please sign in to comment.