-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathclient-secrets.json
More file actions
174 lines (174 loc) · 5.85 KB
/
client-secrets.json
File metadata and controls
174 lines (174 loc) · 5.85 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
162
163
164
165
166
167
168
169
170
171
172
173
174
[
{
"id": "7c28d6f5b81f4cf3",
"type": "tab",
"label": "Realtime Client Secret Example",
"disabled": false,
"info": "Realtime client-secret example.\n\nThis flow demonstrates the correct nested request contract for `createRealtimeClientSecret`:\n- client-secret options such as `expires_after` stay at the top level\n- Realtime session configuration lives under `session`\n- two inject nodes show the newer SDK-typed model ids `gpt-realtime-1.5` and `gpt-audio-1.5`",
"env": []
},
{
"id": "2b6f81da44f1b506",
"type": "comment",
"z": "7c28d6f5b81f4cf3",
"name": "Configure the red-marked node, then run either inject node.",
"info": "Before running:\n- import the flow, then configure the red-marked `OpenAI API` node with your own `Service Host`\n- this example stores request data in `msg.ai` because the `OpenAI API` node property is configured to `ai`\n- if your node uses the default property, the same shape belongs under `msg.payload`\n\nWhat this flow teaches:\n- `expires_after` remains top-level request metadata\n- Realtime session fields are nested under `session`\n- both `gpt-realtime-1.5` and `gpt-audio-1.5` pass through the existing adapter unchanged",
"x": 430,
"y": 140,
"wires": []
},
{
"id": "d48aabf237113ec2",
"type": "comment",
"z": "7c28d6f5b81f4cf3",
"name": "What is a client secret?",
"info": "A Realtime client secret is not your long-lived OpenAI API key.\n\nIt is a short-lived ephemeral token created server-side so a browser or mobile client can connect to the Realtime API without exposing the main API key.\n\nTypical flow:\n- your server or Node-RED flow creates the client secret\n- the returned `value` is passed to a trusted client application\n- that client uses the secret to open a Realtime session before it expires",
"x": 430,
"y": 200,
"wires": []
},
{
"id": "6e1099b8233f4f6f",
"type": "inject",
"z": "7c28d6f5b81f4cf3",
"name": "Create Realtime 1.5 Client Secret",
"props": [
{
"p": "ai.expires_after.anchor",
"v": "created_at",
"vt": "str"
},
{
"p": "ai.expires_after.seconds",
"v": "600",
"vt": "num"
},
{
"p": "ai.session.type",
"v": "realtime",
"vt": "str"
},
{
"p": "ai.session.model",
"v": "gpt-realtime-1.5",
"vt": "str"
},
{
"p": "ai.session.output_modalities[0]",
"v": "audio",
"vt": "str"
},
{
"p": "ai.session.instructions",
"v": "Speak clearly and keep responses concise.",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 300,
"y": 260,
"wires": [
[
"9df67f8a39c32558"
]
]
},
{
"id": "b7fce6b60f312e8a",
"type": "inject",
"z": "7c28d6f5b81f4cf3",
"name": "Create Audio 1.5 Client Secret",
"props": [
{
"p": "ai.expires_after.anchor",
"v": "created_at",
"vt": "str"
},
{
"p": "ai.expires_after.seconds",
"v": "600",
"vt": "num"
},
{
"p": "ai.session.type",
"v": "realtime",
"vt": "str"
},
{
"p": "ai.session.model",
"v": "gpt-audio-1.5",
"vt": "str"
},
{
"p": "ai.session.output_modalities[0]",
"v": "audio",
"vt": "str"
},
{
"p": "ai.session.instructions",
"v": "Generate short audio responses.",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 290,
"y": 340,
"wires": [
[
"9df67f8a39c32558"
]
]
},
{
"id": "65c6ad57d8ef6d54",
"type": "comment",
"z": "7c28d6f5b81f4cf3",
"name": "Expected result: debug sidebar shows value, expires_at, and session.",
"info": "Successful responses from `createRealtimeClientSecret` return top-level `value`, `expires_at`, and `session` fields.\n\nWhat to inspect in the debug sidebar:\n- `session.type` should be `realtime`\n- `session.model` should match the inject node you sent\n- `value` is the ephemeral client secret to hand to a browser or mobile client",
"x": 520,
"y": 420,
"wires": []
},
{
"id": "9df67f8a39c32558",
"type": "OpenAI API",
"z": "7c28d6f5b81f4cf3",
"name": "Create Realtime Client Secret",
"property": "ai",
"propertyType": "msg",
"service": "",
"method": "createRealtimeClientSecret",
"x": 600,
"y": 300,
"wires": [
[
"86453bdf02676d9f"
]
]
},
{
"id": "86453bdf02676d9f",
"type": "debug",
"z": "7c28d6f5b81f4cf3",
"name": "Realtime Client Secret",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 860,
"y": 300,
"wires": []
}
]