mingyang91 commited on
Commit
1bc524e
·
verified ·
1 Parent(s): 9f017df

add http call demo

Browse files

Signed-off-by: 明扬 <[email protected]>

Files changed (3) hide show
  1. http-client.env.json +5 -0
  2. student.http +12 -0
  3. teacher.http +11 -0
http-client.env.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "demo": {
3
+ "exampleServer": "mingyang91-polyhedron.hf.space"
4
+ }
5
+ }
student.http ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### student API
2
+ // IN message: N/A
3
+ // - id: [Required], course ID
4
+ // - language: [Required], zh-CN, en-US
5
+ // - voice: [Required], Takumi
6
+ // *language & voice support matrix*: https://docs.aws.amazon.com/zh_cn/polly/latest/dg/voicelist.html
7
+ // OUT message:
8
+ // example1: {"type":"original","content":"哎,","isFinal":true}
9
+ // example2: {"type":"translated","content":"ねえ、"}
10
+ // example3: {"type":"lipSync","visemes":[{"time":12,"value":"t"},{"time":25,"value":"@"},{"time":200,"value":"sil"}]}
11
+ // example4: Binary data, PCM audio, 16K sampling rate, single channel, 16-bit depth, little endian
12
+ WEBSOCKET wss://{{$exampleServer}}}/ws/student?id=456&language=zh-CN&voice=Takumi
teacher.http ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### teacher API
2
+ // ONLY SUPPORT SINGLE TEACHER PER COURSE ID
3
+ // IN message:
4
+ // Binary data, PCM audio, 16K sampling rate, single channel, 16-bit depth, little endian
5
+ // id: [Required], course ID
6
+ // language: [Required], zh-CN, en-US... (see https://docs.aws.amazon.com/zh_cn/transcribe/latest/dg/supported-languages.html)
7
+ // prompt: [Optional], All background and context about the course topic
8
+ // OUT message:
9
+ // example1: {"type":"original","content":"之后","isFinal":false}
10
+ // example2: {"type":"original","content":"之后的资本就是说做的工作的做的东西","isFinal":true}
11
+ WEBSOCKET wss://{{$exampleServer}}}/ws/teacher?id=456&language=zh-CN&prompt=