Skip to content

Commit fac8946

Browse files
update: add docstring to DefaultCmabService class for improved documentation
1 parent 2563c7b commit fac8946

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

optimizely/cmab/cmab_service.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ class CmabCacheValue(TypedDict):
3535

3636

3737
class DefaultCmabService:
38+
"""
39+
DefaultCmabService handles decisioning for Contextual Multi-Armed Bandit (CMAB) experiments,
40+
including caching and filtering user attributes for efficient decision retrieval.
41+
42+
Attributes:
43+
cmab_cache: LRUCache for user CMAB decisions.
44+
cmab_client: Client to fetch decisions from the CMAB backend.
45+
logger: Optional logger.
46+
47+
Methods:
48+
get_decision: Retrieves a CMAB decision with caching and attribute filtering.
49+
"""
3850
def __init__(self, cmab_cache: LRUCache[str, CmabCacheValue],
3951
cmab_client: DefaultCmabClient, logger: Optional[_logging.Logger] = None):
4052
self.cmab_cache = cmab_cache

0 commit comments

Comments
 (0)