-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathenrich.py
More file actions
34 lines (27 loc) · 795 Bytes
/
enrich.py
File metadata and controls
34 lines (27 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from typing import List, Optional, TypedDict
from datacustomcode.entry_func import entry_func
from datacustomcode.schema import requestSchema, responseSchema
class EnrichRequest(TypedDict):
customer_id: str
age: int
score: float
is_active: bool
tags: List[str]
weights: List[float]
address: Optional[str]
nickname: Optional[str]
class EnrichResponse(TypedDict):
customer_id: str
segment: str
lifetime_value: float
risk_score: int
is_eligible: bool
recommendations: List[str]
feature_vector: List[float]
labels: List[int]
@entry_func
@requestSchema(EnrichRequest)
@responseSchema(EnrichResponse)
def enrich(request: dict) -> dict:
"""Enrich a customer profile with computed features and recommendations."""
return {}