File size: 834 Bytes
149eeaf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
35
from datetime import datetime
import ray
from copy import deepcopy

class AgentState:
    def __init__(self):
        self.timestamp = datetime.utcnow()
        self.input_stt_preview = ''
        self.prompts = []
        self.video_input = None

@ray.remote
class AgentStateActor:
    def __init__(self):
        self.begin_step()

    def begin_step(self):
        self.state = AgentState()
        # self.state = deepcopy(self.state)
        # self.state.timestamp = datetime.utcnow()

    def set_input_stt_preview(self, input_stt_preview):
        self.state.input_stt_preview = input_stt_preview

    def add_input_stt_prompt(self, prompt):
        self.state.prompts.append(prompt)

    def add_video_input(self, video_input):
        self.state.video_input = video_input

    def get_state(self):
        return self.state