File size: 374 Bytes
74aaccc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pydantic import BaseModel
from typing import List

# What agent sees
class Observation(BaseModel):
    user_id: int
    history: List[int]  # previously viewed products


# What agent does
class Action(BaseModel):
    recommended_product: int  # product ID


# Reward returned by environment
class Reward(BaseModel):
    score: float  # between -1 and 1