-
Notifications
You must be signed in to change notification settings - Fork 0
/
flow.json
100 lines (100 loc) · 2.75 KB
/
flow.json
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
[
{
"id": "0ad780d57d4db9fe",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": "",
"env": []
},
{
"id": "1804c8ddeb024db4",
"type": "function",
"z": "0ad780d57d4db9fe",
"name": "set headers to dowload",
"func": "msg.headers = {\n \"content-type\": \"audio/mpeg3;audio/x-mpeg-3;video/mpeg;video/x-mpeg;text/xml\",\n \"content-disposition\": \"attachment; filename=file.mp3\"\n}\n\nmsg.payload = msg.payload\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 160,
"wires": [
[
"a9bf80df93dda1d0"
]
]
},
{
"id": "f1a90d8022a7ee0f",
"type": "http request",
"z": "0ad780d57d4db9fe",
"name": "",
"method": "POST",
"ret": "bin",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 510,
"y": 160,
"wires": [
[
"1804c8ddeb024db4"
]
]
},
{
"id": "e05102ec7b987d72",
"type": "function",
"z": "0ad780d57d4db9fe",
"name": "request config",
"func": "const token = global.get(\"token\");\nmsg.url = `https://api.elevenlabs.io/v1/text-to-speech/${msg.payload.type}`\n msg.headers = {\n 'accept': 'audio/mpeg',\n 'xi-api-key': token,\n 'Content-Type': 'application/json'\n }\n\n msg.payload = {\n \"text\": msg.payload.text,\n \"model_id\": \"eleven_multilingual_v1\",\n \"voice_settings\": {\n \"stability\": 0.5,\n \"similarity_boost\": 0.5\n }\n }\n\nreturn msg",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 160,
"wires": [
[
"f1a90d8022a7ee0f"
]
]
},
{
"id": "246a708720c79812",
"type": "http in",
"z": "0ad780d57d4db9fe",
"name": "",
"url": "/textToSpeech",
"method": "get",
"upload": false,
"swaggerDoc": "",
"x": 130,
"y": 160,
"wires": [
[
"e05102ec7b987d72"
]
]
},
{
"id": "a9bf80df93dda1d0",
"type": "http response",
"z": "0ad780d57d4db9fe",
"name": "",
"statusCode": "",
"headers": {},
"x": 930,
"y": 160,
"wires": []
}
]