-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathregional_agent.py
More file actions
161 lines (144 loc) · 3.93 KB
/
Copy pathregional_agent.py
File metadata and controls
161 lines (144 loc) · 3.93 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
from __future__ import annotations
import typing
from .agent import Agent
from .vendors.base import BaseAvatar, BaseLLM, BaseMLLM, BaseSTT, BaseTTS
from .vendors.cn import (
AliyunLLM,
BytedanceDuplexTTS,
BytedanceLLM,
BytedanceTTS,
CosyVoiceTTS,
DeepSeekLLM,
FengmingSTT,
MiniMaxTTS as MiniMaxCNTTS,
MicrosoftSTT as MicrosoftCNSTT,
MicrosoftTTS as MicrosoftCNTTS,
QwenOmni,
SenseTimeAvatar,
SpatiusAvatar,
StepFunTTS,
TencentLLM,
TencentSTT,
TencentTTS,
XfyunBigModelSTT,
XfyunDialectSTT,
XfyunSTT,
)
from .vendors.stt import (
AmazonSTT,
AresSTT,
AssemblyAISTT,
DeepgramSTT,
GoogleSTT,
MicrosoftSTT,
OpenAISTT,
SarvamSTT,
SpeechmaticsSTT,
XaiSTT,
)
from .vendors.llm import (
AmazonBedrock,
Anthropic,
AzureOpenAI,
CustomLLM,
Dify,
Gemini,
Groq,
OpenAI,
VertexAILLM,
)
from .vendors.mllm import AzureOpenAIRealtime, GeminiLive, OpenAIRealtime, VertexAI, XaiGrok
from .vendors.tts import (
AmazonTTS,
CartesiaTTS,
DeepgramTTS,
ElevenLabsTTS,
FishAudioTTS,
GoogleTTS,
GradiumTTS,
HumeAITTS,
MicrosoftTTS,
MiniMaxTTS,
MistralTTS,
MurfTTS,
OpenAITTS,
GenericTTS,
RimeTTS,
SarvamTTS,
TypecastTTS,
XaiTTS,
)
from .vendors.avatar import AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar
CNSTT = typing.Union[TencentSTT, FengmingSTT, MicrosoftCNSTT, XfyunSTT, XfyunBigModelSTT, XfyunDialectSTT]
CNTTS = typing.Union[MiniMaxCNTTS, TencentTTS, BytedanceTTS, MicrosoftCNTTS, CosyVoiceTTS, BytedanceDuplexTTS, StepFunTTS, GenericTTS]
CNLLM = typing.Union[AliyunLLM, BytedanceLLM, DeepSeekLLM, TencentLLM]
CNMLLM = QwenOmni
CNAvatar = typing.Union[SenseTimeAvatar, SpatiusAvatar]
GlobalSTT = typing.Union[
AresSTT,
DeepgramSTT,
MicrosoftSTT,
OpenAISTT,
GoogleSTT,
AmazonSTT,
AssemblyAISTT,
SpeechmaticsSTT,
SarvamSTT,
XaiSTT,
]
GlobalTTS = typing.Union[
MicrosoftTTS,
ElevenLabsTTS,
MiniMaxTTS,
MurfTTS,
CartesiaTTS,
OpenAITTS,
HumeAITTS,
RimeTTS,
FishAudioTTS,
GoogleTTS,
AmazonTTS,
SarvamTTS,
GenericTTS,
XaiTTS,
DeepgramTTS,
GradiumTTS,
MistralTTS,
TypecastTTS,
]
GlobalLLM = typing.Union[
OpenAI,
AzureOpenAI,
Anthropic,
Gemini,
Groq,
VertexAILLM,
AmazonBedrock,
Dify,
CustomLLM,
]
GlobalMLLM = typing.Union[OpenAIRealtime, AzureOpenAIRealtime, GeminiLive, VertexAI, XaiGrok]
GlobalAvatar = typing.Union[AkoolAvatar, LiveAvatarAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar]
class CNAgent(Agent):
def with_stt(self, vendor: BaseSTT) -> "CNAgent":
return typing.cast("CNAgent", super().with_stt(vendor))
def with_llm(self, vendor: BaseLLM) -> "CNAgent":
return typing.cast("CNAgent", super().with_llm(vendor))
def with_tts(self, vendor: BaseTTS) -> "CNAgent":
return typing.cast("CNAgent", super().with_tts(vendor))
def with_mllm(self, vendor: BaseMLLM) -> "CNAgent":
return typing.cast("CNAgent", super().with_mllm(vendor))
def with_avatar(self, vendor: BaseAvatar) -> "CNAgent":
return typing.cast("CNAgent", super().with_avatar(vendor))
class GlobalAgent(Agent):
def with_stt(self, vendor: BaseSTT) -> "GlobalAgent":
return typing.cast("GlobalAgent", super().with_stt(vendor))
def with_llm(self, vendor: BaseLLM) -> "GlobalAgent":
return typing.cast("GlobalAgent", super().with_llm(vendor))
def with_tts(self, vendor: BaseTTS) -> "GlobalAgent":
return typing.cast("GlobalAgent", super().with_tts(vendor))
def with_mllm(self, vendor: BaseMLLM) -> "GlobalAgent":
return typing.cast("GlobalAgent", super().with_mllm(vendor))
def with_avatar(self, vendor: BaseAvatar) -> "GlobalAgent":
return typing.cast("GlobalAgent", super().with_avatar(vendor))
RegionalAgent = typing.Union[CNAgent, GlobalAgent]