@inductiv/node-red-openai-api 6.22.0 → 6.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -84
- package/examples/realtime/client-secrets.json +182 -0
- package/examples/responses/computer-use.json +142 -0
- package/examples/responses/phase.json +102 -0
- package/examples/responses/tool-search.json +107 -0
- package/examples/responses/websocket.json +172 -0
- package/internals/openai-api-features-v6.23.0-v6.27.0.md +96 -0
- package/lib.js +4073 -117
- package/locales/en-US/node.json +1 -0
- package/node.html +177 -11
- package/node.js +10 -0
- package/package.json +4 -3
- package/src/realtime/help.html +89 -9
- package/src/responses/help.html +83 -2
- package/src/responses/methods.js +185 -0
- package/src/responses/template.html +5 -0
- package/src/responses/websocket.js +150 -0
- package/test/openai-methods-mapping.test.js +346 -7
- package/test/openai-node-auth-routing.test.js +3 -0
- package/test/openai-responses-websocket.test.js +472 -0
- package/test/service-host-editor-template.test.js +3 -0
- package/test/service-host-node.test.js +3 -0
- package/test/services.test.js +3 -0
- package/test/utils.test.js +3 -0
package/locales/en-US/node.json
CHANGED
|
@@ -140,6 +140,7 @@
|
|
|
140
140
|
"compactModelResponse": "compact model response",
|
|
141
141
|
"listInputItems": "list input items",
|
|
142
142
|
"countInputTokens": "count input tokens",
|
|
143
|
+
"manageModelResponseWebSocket": "manage model response websocket",
|
|
143
144
|
"listSkills": "list skills",
|
|
144
145
|
"createSkill": "create skill",
|
|
145
146
|
"getSkill": "retrieve skill",
|
package/node.html
CHANGED
|
@@ -357,6 +357,11 @@
|
|
|
357
357
|
data-i18n="OpenaiApi.parameters.countInputTokens"
|
|
358
358
|
></option>
|
|
359
359
|
|
|
360
|
+
<option
|
|
361
|
+
value="manageModelResponseWebSocket"
|
|
362
|
+
data-i18n="OpenaiApi.parameters.manageModelResponseWebSocket"
|
|
363
|
+
></option>
|
|
364
|
+
|
|
360
365
|
</optgroup>
|
|
361
366
|
|
|
362
367
|
<optgroup style="font-style: normal;" label="🔄 Runs (Beta)">
|
|
@@ -2673,44 +2678,87 @@
|
|
|
2673
2678
|
|
|
2674
2679
|
<h4 style="font-weight: bolder;"> ⋙ Create Realtime Client Secret</h4>
|
|
2675
2680
|
<p>Create an ephemeral client secret for browser/mobile realtime sessions.</p>
|
|
2681
|
+
<p>Put Realtime session configuration inside <code>msg.payload.session</code>. Top-level
|
|
2682
|
+
<code>msg.payload</code> is reserved for client-secret options such as
|
|
2683
|
+
<code>expires_after</code>.</p>
|
|
2676
2684
|
<dl class="message-properties">
|
|
2677
2685
|
<h4>msg.payload Properties</h4>
|
|
2678
2686
|
<dt class="optional">
|
|
2679
|
-
|
|
2687
|
+
expires_after
|
|
2688
|
+
<span class="property-type">object</span>
|
|
2689
|
+
</dt>
|
|
2690
|
+
<dd>Optional client-secret expiration config, for example
|
|
2691
|
+
<code>{ "anchor": "created_at", "seconds": 600 }</code>.</dd>
|
|
2692
|
+
<dt class="optional">
|
|
2693
|
+
session
|
|
2694
|
+
<span class="property-type">object</span>
|
|
2695
|
+
</dt>
|
|
2696
|
+
<dd>Realtime session configuration to attach to the generated client secret.</dd>
|
|
2697
|
+
<dt>
|
|
2698
|
+
session.type
|
|
2680
2699
|
<span class="property-type">string</span>
|
|
2681
2700
|
</dt>
|
|
2682
|
-
<dd>Realtime
|
|
2701
|
+
<dd>Must be <code>realtime</code> for a Realtime session.</dd>
|
|
2683
2702
|
<dt class="optional">
|
|
2684
|
-
|
|
2703
|
+
session.model
|
|
2704
|
+
<span class="property-type">string</span>
|
|
2705
|
+
</dt>
|
|
2706
|
+
<dd>Realtime model id, including newer SDK-supported ids such as
|
|
2707
|
+
<code>gpt-realtime-1.5</code> and <code>gpt-audio-1.5</code>.</dd>
|
|
2708
|
+
<dt class="optional">
|
|
2709
|
+
session.instructions
|
|
2685
2710
|
<span class="property-type">string</span>
|
|
2686
2711
|
</dt>
|
|
2687
2712
|
<dd>Default system instructions for the session.</dd>
|
|
2688
2713
|
<dt class="optional">
|
|
2689
|
-
|
|
2714
|
+
session.include
|
|
2715
|
+
<span class="property-type">array</span>
|
|
2716
|
+
</dt>
|
|
2717
|
+
<dd>Additional server output fields to include, such as
|
|
2718
|
+
<code>item.input_audio_transcription.logprobs</code>.</dd>
|
|
2719
|
+
<dt class="optional">
|
|
2720
|
+
session.max_output_tokens
|
|
2721
|
+
<span class="property-type">integer | string</span>
|
|
2722
|
+
</dt>
|
|
2723
|
+
<dd>Maximum output tokens per assistant response, or <code>inf</code>.</dd>
|
|
2724
|
+
<dt class="optional">
|
|
2725
|
+
session.output_modalities
|
|
2690
2726
|
<span class="property-type">array</span>
|
|
2691
2727
|
</dt>
|
|
2692
2728
|
<dd>Output modalities such as <code>text</code> or <code>audio</code>.</dd>
|
|
2693
2729
|
<dt class="optional">
|
|
2694
|
-
audio
|
|
2730
|
+
session.audio
|
|
2695
2731
|
<span class="property-type">object</span>
|
|
2696
2732
|
</dt>
|
|
2697
2733
|
<dd>Input/output audio config for the session.</dd>
|
|
2698
2734
|
<dt class="optional">
|
|
2699
|
-
|
|
2735
|
+
session.prompt
|
|
2736
|
+
<span class="property-type">object</span>
|
|
2737
|
+
</dt>
|
|
2738
|
+
<dd>Reusable prompt reference and variables for the session.</dd>
|
|
2739
|
+
<dt class="optional">
|
|
2740
|
+
session.tools
|
|
2700
2741
|
<span class="property-type">array</span>
|
|
2701
2742
|
</dt>
|
|
2702
2743
|
<dd>Tools available to the realtime model.</dd>
|
|
2703
2744
|
<dt class="optional">
|
|
2704
|
-
tool_choice
|
|
2745
|
+
session.tool_choice
|
|
2705
2746
|
<span class="property-type">string | object</span>
|
|
2706
2747
|
</dt>
|
|
2707
2748
|
<dd>How tools are selected.</dd>
|
|
2708
2749
|
<dt class="optional">
|
|
2709
|
-
tracing
|
|
2750
|
+
session.tracing
|
|
2710
2751
|
<span class="property-type">string | object | null</span>
|
|
2711
2752
|
</dt>
|
|
2712
2753
|
<dd>Trace configuration for the realtime session.</dd>
|
|
2754
|
+
<dt class="optional">
|
|
2755
|
+
session.truncation
|
|
2756
|
+
<span class="property-type">string | object</span>
|
|
2757
|
+
</dt>
|
|
2758
|
+
<dd>Conversation truncation behavior for the session.</dd>
|
|
2713
2759
|
</dl>
|
|
2760
|
+
<p>Successful responses are returned in <code>msg.payload</code> with top-level
|
|
2761
|
+
<code>value</code>, <code>expires_at</code>, and <code>session</code> fields.</p>
|
|
2714
2762
|
|
|
2715
2763
|
<h4 style="font-weight: bolder;"> ⋙ Accept Realtime Call</h4>
|
|
2716
2764
|
<p>Accept an incoming SIP call and attach it to a realtime session.</p>
|
|
@@ -2726,16 +2774,43 @@
|
|
|
2726
2774
|
<span class="property-type">string</span>
|
|
2727
2775
|
</dt>
|
|
2728
2776
|
<dd>Must be <code>realtime</code>.</dd>
|
|
2777
|
+
<dt class="optional">
|
|
2778
|
+
include
|
|
2779
|
+
<span class="property-type">array</span>
|
|
2780
|
+
</dt>
|
|
2781
|
+
<dd>Additional server output fields to include, such as
|
|
2782
|
+
<code>item.input_audio_transcription.logprobs</code>.</dd>
|
|
2729
2783
|
<dt class="optional">
|
|
2730
2784
|
model
|
|
2731
2785
|
<span class="property-type">string</span>
|
|
2732
2786
|
</dt>
|
|
2733
|
-
<dd>Realtime model id for the accepted call
|
|
2787
|
+
<dd>Realtime model id for the accepted call, including newer SDK-supported ids such as
|
|
2788
|
+
<code>gpt-realtime-1.5</code> and <code>gpt-audio-1.5</code>.</dd>
|
|
2734
2789
|
<dt class="optional">
|
|
2735
2790
|
instructions
|
|
2736
2791
|
<span class="property-type">string</span>
|
|
2737
2792
|
</dt>
|
|
2738
2793
|
<dd>System instructions for the call session.</dd>
|
|
2794
|
+
<dt class="optional">
|
|
2795
|
+
max_output_tokens
|
|
2796
|
+
<span class="property-type">integer | string</span>
|
|
2797
|
+
</dt>
|
|
2798
|
+
<dd>Maximum output tokens per assistant response, or <code>inf</code>.</dd>
|
|
2799
|
+
<dt class="optional">
|
|
2800
|
+
output_modalities
|
|
2801
|
+
<span class="property-type">array</span>
|
|
2802
|
+
</dt>
|
|
2803
|
+
<dd>Output modalities such as <code>text</code> or <code>audio</code>.</dd>
|
|
2804
|
+
<dt class="optional">
|
|
2805
|
+
audio
|
|
2806
|
+
<span class="property-type">object</span>
|
|
2807
|
+
</dt>
|
|
2808
|
+
<dd>Input/output audio config for the accepted call session.</dd>
|
|
2809
|
+
<dt class="optional">
|
|
2810
|
+
prompt
|
|
2811
|
+
<span class="property-type">object</span>
|
|
2812
|
+
</dt>
|
|
2813
|
+
<dd>Reusable prompt reference and variables for the call session.</dd>
|
|
2739
2814
|
<dt class="optional">
|
|
2740
2815
|
tools
|
|
2741
2816
|
<span class="property-type">array</span>
|
|
@@ -2746,6 +2821,16 @@
|
|
|
2746
2821
|
<span class="property-type">string | object</span>
|
|
2747
2822
|
</dt>
|
|
2748
2823
|
<dd>Tool selection strategy.</dd>
|
|
2824
|
+
<dt class="optional">
|
|
2825
|
+
tracing
|
|
2826
|
+
<span class="property-type">string | object | null</span>
|
|
2827
|
+
</dt>
|
|
2828
|
+
<dd>Trace configuration for the accepted call session.</dd>
|
|
2829
|
+
<dt class="optional">
|
|
2830
|
+
truncation
|
|
2831
|
+
<span class="property-type">string | object</span>
|
|
2832
|
+
</dt>
|
|
2833
|
+
<dd>Conversation truncation behavior for the call session.</dd>
|
|
2749
2834
|
</dl>
|
|
2750
2835
|
|
|
2751
2836
|
<h4 style="font-weight: bolder;"> ⋙ Hangup Realtime Call</h4>
|
|
@@ -2809,13 +2894,20 @@
|
|
|
2809
2894
|
input
|
|
2810
2895
|
<span class="property-type">string | array</span>
|
|
2811
2896
|
</dt>
|
|
2812
|
-
<dd>
|
|
2897
|
+
<dd>
|
|
2898
|
+
Text, image, or file inputs to the model, used to generate a response.
|
|
2899
|
+
For assistant message items in an array input, you may also set
|
|
2900
|
+
<code>phase</code> to <code>commentary</code> or <code>final_answer</code>.
|
|
2901
|
+
</dd>
|
|
2813
2902
|
|
|
2814
2903
|
<dt>
|
|
2815
2904
|
model
|
|
2816
2905
|
<span class="property-type">string</span>
|
|
2817
2906
|
</dt>
|
|
2818
|
-
<dd>
|
|
2907
|
+
<dd>
|
|
2908
|
+
Model ID used to generate the response, including newer Responses-compatible
|
|
2909
|
+
model strings such as <code>gpt-5.4</code>.
|
|
2910
|
+
</dd>
|
|
2819
2911
|
|
|
2820
2912
|
<dt class="optional">
|
|
2821
2913
|
background
|
|
@@ -2950,6 +3042,13 @@
|
|
|
2950
3042
|
</dt>
|
|
2951
3043
|
<dd>
|
|
2952
3044
|
An array of tools the model may call while generating a response.
|
|
3045
|
+
This includes Model Context Protocol tools, Tool Search via
|
|
3046
|
+
<code>{ "type": "tool_search" }</code>, and GA computer use via
|
|
3047
|
+
<code>{ "type": "computer" }</code>.
|
|
3048
|
+
Deferred tool loading is supported by setting
|
|
3049
|
+
<code>defer_loading: true</code> on tool definitions.
|
|
3050
|
+
Computer-tool workflows typically require follow-up requests that send
|
|
3051
|
+
<code>computer_call_output</code> items back through <code>input</code>.
|
|
2953
3052
|
For Model Context Protocol (MCP) tools, each object in the array should follow <a
|
|
2954
3053
|
href="https://platform.openai.com/docs/guides/tools-remote-mcp?lang=javascript&utm_source==%40inductiv%2Fnode-red-openai-api"
|
|
2955
3054
|
target="_blank">this
|
|
@@ -3183,6 +3282,73 @@
|
|
|
3183
3282
|
|
|
3184
3283
|
</dl>
|
|
3185
3284
|
|
|
3285
|
+
<h4 style="font-weight: bolder;"> ⋙ Manage Model Response WebSocket</h4>
|
|
3286
|
+
<p>
|
|
3287
|
+
Opens, uses, and closes a persistent Responses websocket connection from a single
|
|
3288
|
+
<code>OpenAI API</code> node instance.
|
|
3289
|
+
</p>
|
|
3290
|
+
<p>
|
|
3291
|
+
Use the same node instance for all websocket actions. Set <code>msg.payload.action</code> to
|
|
3292
|
+
<code>connect</code>, <code>send</code>, or <code>close</code>.
|
|
3293
|
+
</p>
|
|
3294
|
+
<p>
|
|
3295
|
+
Incoming server events are emitted asynchronously from this node as new messages with the raw
|
|
3296
|
+
event object in <code>msg.payload</code>. Connection metadata is added under
|
|
3297
|
+
<code>msg.openai</code>.
|
|
3298
|
+
</p>
|
|
3299
|
+
<dl class="message-properties">
|
|
3300
|
+
<h4>msg.payload Properties</h4>
|
|
3301
|
+
|
|
3302
|
+
<dt>
|
|
3303
|
+
action
|
|
3304
|
+
<span class="property-type">string</span>
|
|
3305
|
+
</dt>
|
|
3306
|
+
<dd>
|
|
3307
|
+
Required lifecycle action. Must be <code>connect</code>, <code>send</code>, or
|
|
3308
|
+
<code>close</code>.
|
|
3309
|
+
</dd>
|
|
3310
|
+
|
|
3311
|
+
<dt>
|
|
3312
|
+
connection_id
|
|
3313
|
+
<span class="property-type">string</span>
|
|
3314
|
+
</dt>
|
|
3315
|
+
<dd>
|
|
3316
|
+
Stable identifier for the websocket connection owned by this node instance.
|
|
3317
|
+
</dd>
|
|
3318
|
+
|
|
3319
|
+
<dt class="optional">
|
|
3320
|
+
event
|
|
3321
|
+
<span class="property-type">object</span>
|
|
3322
|
+
</dt>
|
|
3323
|
+
<dd>
|
|
3324
|
+
Required when <code>action</code> is <code>send</code>. Provide a Responses client event,
|
|
3325
|
+
currently <code>{ "type": "response.create", ... }</code>.
|
|
3326
|
+
</dd>
|
|
3327
|
+
|
|
3328
|
+
<dt class="optional">
|
|
3329
|
+
code
|
|
3330
|
+
<span class="property-type">integer</span>
|
|
3331
|
+
</dt>
|
|
3332
|
+
<dd>
|
|
3333
|
+
Optional websocket close code used when <code>action</code> is <code>close</code>.
|
|
3334
|
+
Defaults to <code>1000</code>.
|
|
3335
|
+
</dd>
|
|
3336
|
+
|
|
3337
|
+
<dt class="optional">
|
|
3338
|
+
reason
|
|
3339
|
+
<span class="property-type">string</span>
|
|
3340
|
+
</dt>
|
|
3341
|
+
<dd>
|
|
3342
|
+
Optional websocket close reason used when <code>action</code> is <code>close</code>.
|
|
3343
|
+
Defaults to <code>OK</code>.
|
|
3344
|
+
</dd>
|
|
3345
|
+
|
|
3346
|
+
</dl>
|
|
3347
|
+
<p>
|
|
3348
|
+
The websocket URL is derived from the configured <code>Service Host</code> API Base using the
|
|
3349
|
+
same auth contract as the rest of this node, including custom auth headers and query-string auth.
|
|
3350
|
+
</p>
|
|
3351
|
+
|
|
3186
3352
|
</details>
|
|
3187
3353
|
</section>
|
|
3188
3354
|
|
package/node.js
CHANGED
|
@@ -43,6 +43,10 @@ module.exports = function (RED) {
|
|
|
43
43
|
let node = this;
|
|
44
44
|
node.service = RED.nodes.getNode(config.service);
|
|
45
45
|
node.config = config;
|
|
46
|
+
node._cleanupHandlers = [];
|
|
47
|
+
node.registerCleanupHandler = function (handler) {
|
|
48
|
+
node._cleanupHandlers.push(handler);
|
|
49
|
+
};
|
|
46
50
|
|
|
47
51
|
node.on("input", function (msg) {
|
|
48
52
|
if (!node.service) {
|
|
@@ -144,6 +148,12 @@ module.exports = function (RED) {
|
|
|
144
148
|
node.error(errorMessage, msg);
|
|
145
149
|
});
|
|
146
150
|
});
|
|
151
|
+
|
|
152
|
+
node.on("close", function (done) {
|
|
153
|
+
Promise.all(node._cleanupHandlers.map((handler) => handler())).then(
|
|
154
|
+
() => done()
|
|
155
|
+
).catch(done);
|
|
156
|
+
});
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
159
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inductiv/node-red-openai-api",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.27.0",
|
|
4
4
|
"description": "Enhance your Node-RED projects with advanced AI capabilities.",
|
|
5
5
|
"main": "node.js",
|
|
6
6
|
"engines": {
|
|
@@ -33,11 +33,12 @@
|
|
|
33
33
|
"build:html": "gulp build-html",
|
|
34
34
|
"build:js": "esbuild src/lib.js --bundle --outfile=lib.js --format=cjs --platform=node",
|
|
35
35
|
"build": "npm run build:html && npm run build:js",
|
|
36
|
-
"test": "node --test test/service-host-node.test.js test/service-host-editor-template.test.js test/openai-node-auth-routing.test.js test/openai-methods-mapping.test.js",
|
|
36
|
+
"test": "node --test test/service-host-node.test.js test/service-host-editor-template.test.js test/openai-node-auth-routing.test.js test/openai-methods-mapping.test.js test/openai-responses-websocket.test.js",
|
|
37
37
|
"prepare": "npm run build"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"openai": "^6.
|
|
40
|
+
"openai": "^6.27.0",
|
|
41
|
+
"ws": "^8.19.0"
|
|
41
42
|
},
|
|
42
43
|
"author": "Allan Bunch",
|
|
43
44
|
"license": "MIT",
|
package/src/realtime/help.html
CHANGED
|
@@ -6,44 +6,87 @@
|
|
|
6
6
|
|
|
7
7
|
<h4 style="font-weight: bolder;"> ⋙ Create Realtime Client Secret</h4>
|
|
8
8
|
<p>Create an ephemeral client secret for browser/mobile realtime sessions.</p>
|
|
9
|
+
<p>Put Realtime session configuration inside <code>msg.payload.session</code>. Top-level
|
|
10
|
+
<code>msg.payload</code> is reserved for client-secret options such as
|
|
11
|
+
<code>expires_after</code>.</p>
|
|
9
12
|
<dl class="message-properties">
|
|
10
13
|
<h4>msg.payload Properties</h4>
|
|
11
14
|
<dt class="optional">
|
|
12
|
-
|
|
15
|
+
expires_after
|
|
16
|
+
<span class="property-type">object</span>
|
|
17
|
+
</dt>
|
|
18
|
+
<dd>Optional client-secret expiration config, for example
|
|
19
|
+
<code>{ "anchor": "created_at", "seconds": 600 }</code>.</dd>
|
|
20
|
+
<dt class="optional">
|
|
21
|
+
session
|
|
22
|
+
<span class="property-type">object</span>
|
|
23
|
+
</dt>
|
|
24
|
+
<dd>Realtime session configuration to attach to the generated client secret.</dd>
|
|
25
|
+
<dt>
|
|
26
|
+
session.type
|
|
13
27
|
<span class="property-type">string</span>
|
|
14
28
|
</dt>
|
|
15
|
-
<dd>Realtime
|
|
29
|
+
<dd>Must be <code>realtime</code> for a Realtime session.</dd>
|
|
16
30
|
<dt class="optional">
|
|
17
|
-
|
|
31
|
+
session.model
|
|
32
|
+
<span class="property-type">string</span>
|
|
33
|
+
</dt>
|
|
34
|
+
<dd>Realtime model id, including newer SDK-supported ids such as
|
|
35
|
+
<code>gpt-realtime-1.5</code> and <code>gpt-audio-1.5</code>.</dd>
|
|
36
|
+
<dt class="optional">
|
|
37
|
+
session.instructions
|
|
18
38
|
<span class="property-type">string</span>
|
|
19
39
|
</dt>
|
|
20
40
|
<dd>Default system instructions for the session.</dd>
|
|
21
41
|
<dt class="optional">
|
|
22
|
-
|
|
42
|
+
session.include
|
|
43
|
+
<span class="property-type">array</span>
|
|
44
|
+
</dt>
|
|
45
|
+
<dd>Additional server output fields to include, such as
|
|
46
|
+
<code>item.input_audio_transcription.logprobs</code>.</dd>
|
|
47
|
+
<dt class="optional">
|
|
48
|
+
session.max_output_tokens
|
|
49
|
+
<span class="property-type">integer | string</span>
|
|
50
|
+
</dt>
|
|
51
|
+
<dd>Maximum output tokens per assistant response, or <code>inf</code>.</dd>
|
|
52
|
+
<dt class="optional">
|
|
53
|
+
session.output_modalities
|
|
23
54
|
<span class="property-type">array</span>
|
|
24
55
|
</dt>
|
|
25
56
|
<dd>Output modalities such as <code>text</code> or <code>audio</code>.</dd>
|
|
26
57
|
<dt class="optional">
|
|
27
|
-
audio
|
|
58
|
+
session.audio
|
|
28
59
|
<span class="property-type">object</span>
|
|
29
60
|
</dt>
|
|
30
61
|
<dd>Input/output audio config for the session.</dd>
|
|
31
62
|
<dt class="optional">
|
|
32
|
-
|
|
63
|
+
session.prompt
|
|
64
|
+
<span class="property-type">object</span>
|
|
65
|
+
</dt>
|
|
66
|
+
<dd>Reusable prompt reference and variables for the session.</dd>
|
|
67
|
+
<dt class="optional">
|
|
68
|
+
session.tools
|
|
33
69
|
<span class="property-type">array</span>
|
|
34
70
|
</dt>
|
|
35
71
|
<dd>Tools available to the realtime model.</dd>
|
|
36
72
|
<dt class="optional">
|
|
37
|
-
tool_choice
|
|
73
|
+
session.tool_choice
|
|
38
74
|
<span class="property-type">string | object</span>
|
|
39
75
|
</dt>
|
|
40
76
|
<dd>How tools are selected.</dd>
|
|
41
77
|
<dt class="optional">
|
|
42
|
-
tracing
|
|
78
|
+
session.tracing
|
|
43
79
|
<span class="property-type">string | object | null</span>
|
|
44
80
|
</dt>
|
|
45
81
|
<dd>Trace configuration for the realtime session.</dd>
|
|
82
|
+
<dt class="optional">
|
|
83
|
+
session.truncation
|
|
84
|
+
<span class="property-type">string | object</span>
|
|
85
|
+
</dt>
|
|
86
|
+
<dd>Conversation truncation behavior for the session.</dd>
|
|
46
87
|
</dl>
|
|
88
|
+
<p>Successful responses are returned in <code>msg.payload</code> with top-level
|
|
89
|
+
<code>value</code>, <code>expires_at</code>, and <code>session</code> fields.</p>
|
|
47
90
|
|
|
48
91
|
<h4 style="font-weight: bolder;"> ⋙ Accept Realtime Call</h4>
|
|
49
92
|
<p>Accept an incoming SIP call and attach it to a realtime session.</p>
|
|
@@ -59,16 +102,43 @@
|
|
|
59
102
|
<span class="property-type">string</span>
|
|
60
103
|
</dt>
|
|
61
104
|
<dd>Must be <code>realtime</code>.</dd>
|
|
105
|
+
<dt class="optional">
|
|
106
|
+
include
|
|
107
|
+
<span class="property-type">array</span>
|
|
108
|
+
</dt>
|
|
109
|
+
<dd>Additional server output fields to include, such as
|
|
110
|
+
<code>item.input_audio_transcription.logprobs</code>.</dd>
|
|
62
111
|
<dt class="optional">
|
|
63
112
|
model
|
|
64
113
|
<span class="property-type">string</span>
|
|
65
114
|
</dt>
|
|
66
|
-
<dd>Realtime model id for the accepted call
|
|
115
|
+
<dd>Realtime model id for the accepted call, including newer SDK-supported ids such as
|
|
116
|
+
<code>gpt-realtime-1.5</code> and <code>gpt-audio-1.5</code>.</dd>
|
|
67
117
|
<dt class="optional">
|
|
68
118
|
instructions
|
|
69
119
|
<span class="property-type">string</span>
|
|
70
120
|
</dt>
|
|
71
121
|
<dd>System instructions for the call session.</dd>
|
|
122
|
+
<dt class="optional">
|
|
123
|
+
max_output_tokens
|
|
124
|
+
<span class="property-type">integer | string</span>
|
|
125
|
+
</dt>
|
|
126
|
+
<dd>Maximum output tokens per assistant response, or <code>inf</code>.</dd>
|
|
127
|
+
<dt class="optional">
|
|
128
|
+
output_modalities
|
|
129
|
+
<span class="property-type">array</span>
|
|
130
|
+
</dt>
|
|
131
|
+
<dd>Output modalities such as <code>text</code> or <code>audio</code>.</dd>
|
|
132
|
+
<dt class="optional">
|
|
133
|
+
audio
|
|
134
|
+
<span class="property-type">object</span>
|
|
135
|
+
</dt>
|
|
136
|
+
<dd>Input/output audio config for the accepted call session.</dd>
|
|
137
|
+
<dt class="optional">
|
|
138
|
+
prompt
|
|
139
|
+
<span class="property-type">object</span>
|
|
140
|
+
</dt>
|
|
141
|
+
<dd>Reusable prompt reference and variables for the call session.</dd>
|
|
72
142
|
<dt class="optional">
|
|
73
143
|
tools
|
|
74
144
|
<span class="property-type">array</span>
|
|
@@ -79,6 +149,16 @@
|
|
|
79
149
|
<span class="property-type">string | object</span>
|
|
80
150
|
</dt>
|
|
81
151
|
<dd>Tool selection strategy.</dd>
|
|
152
|
+
<dt class="optional">
|
|
153
|
+
tracing
|
|
154
|
+
<span class="property-type">string | object | null</span>
|
|
155
|
+
</dt>
|
|
156
|
+
<dd>Trace configuration for the accepted call session.</dd>
|
|
157
|
+
<dt class="optional">
|
|
158
|
+
truncation
|
|
159
|
+
<span class="property-type">string | object</span>
|
|
160
|
+
</dt>
|
|
161
|
+
<dd>Conversation truncation behavior for the call session.</dd>
|
|
82
162
|
</dl>
|
|
83
163
|
|
|
84
164
|
<h4 style="font-weight: bolder;"> ⋙ Hangup Realtime Call</h4>
|
package/src/responses/help.html
CHANGED
|
@@ -12,13 +12,20 @@
|
|
|
12
12
|
input
|
|
13
13
|
<span class="property-type">string | array</span>
|
|
14
14
|
</dt>
|
|
15
|
-
<dd>
|
|
15
|
+
<dd>
|
|
16
|
+
Text, image, or file inputs to the model, used to generate a response.
|
|
17
|
+
For assistant message items in an array input, you may also set
|
|
18
|
+
<code>phase</code> to <code>commentary</code> or <code>final_answer</code>.
|
|
19
|
+
</dd>
|
|
16
20
|
|
|
17
21
|
<dt>
|
|
18
22
|
model
|
|
19
23
|
<span class="property-type">string</span>
|
|
20
24
|
</dt>
|
|
21
|
-
<dd>
|
|
25
|
+
<dd>
|
|
26
|
+
Model ID used to generate the response, including newer Responses-compatible
|
|
27
|
+
model strings such as <code>gpt-5.4</code>.
|
|
28
|
+
</dd>
|
|
22
29
|
|
|
23
30
|
<dt class="optional">
|
|
24
31
|
background
|
|
@@ -153,6 +160,13 @@
|
|
|
153
160
|
</dt>
|
|
154
161
|
<dd>
|
|
155
162
|
An array of tools the model may call while generating a response.
|
|
163
|
+
This includes Model Context Protocol tools, Tool Search via
|
|
164
|
+
<code>{ "type": "tool_search" }</code>, and GA computer use via
|
|
165
|
+
<code>{ "type": "computer" }</code>.
|
|
166
|
+
Deferred tool loading is supported by setting
|
|
167
|
+
<code>defer_loading: true</code> on tool definitions.
|
|
168
|
+
Computer-tool workflows typically require follow-up requests that send
|
|
169
|
+
<code>computer_call_output</code> items back through <code>input</code>.
|
|
156
170
|
For Model Context Protocol (MCP) tools, each object in the array should follow <a
|
|
157
171
|
href="https://platform.openai.com/docs/guides/tools-remote-mcp?lang=javascript&utm_source==%40inductiv%2Fnode-red-openai-api"
|
|
158
172
|
target="_blank">this
|
|
@@ -386,5 +400,72 @@
|
|
|
386
400
|
|
|
387
401
|
</dl>
|
|
388
402
|
|
|
403
|
+
<h4 style="font-weight: bolder;"> ⋙ Manage Model Response WebSocket</h4>
|
|
404
|
+
<p>
|
|
405
|
+
Opens, uses, and closes a persistent Responses websocket connection from a single
|
|
406
|
+
<code>OpenAI API</code> node instance.
|
|
407
|
+
</p>
|
|
408
|
+
<p>
|
|
409
|
+
Use the same node instance for all websocket actions. Set <code>msg.payload.action</code> to
|
|
410
|
+
<code>connect</code>, <code>send</code>, or <code>close</code>.
|
|
411
|
+
</p>
|
|
412
|
+
<p>
|
|
413
|
+
Incoming server events are emitted asynchronously from this node as new messages with the raw
|
|
414
|
+
event object in <code>msg.payload</code>. Connection metadata is added under
|
|
415
|
+
<code>msg.openai</code>.
|
|
416
|
+
</p>
|
|
417
|
+
<dl class="message-properties">
|
|
418
|
+
<h4>msg.payload Properties</h4>
|
|
419
|
+
|
|
420
|
+
<dt>
|
|
421
|
+
action
|
|
422
|
+
<span class="property-type">string</span>
|
|
423
|
+
</dt>
|
|
424
|
+
<dd>
|
|
425
|
+
Required lifecycle action. Must be <code>connect</code>, <code>send</code>, or
|
|
426
|
+
<code>close</code>.
|
|
427
|
+
</dd>
|
|
428
|
+
|
|
429
|
+
<dt>
|
|
430
|
+
connection_id
|
|
431
|
+
<span class="property-type">string</span>
|
|
432
|
+
</dt>
|
|
433
|
+
<dd>
|
|
434
|
+
Stable identifier for the websocket connection owned by this node instance.
|
|
435
|
+
</dd>
|
|
436
|
+
|
|
437
|
+
<dt class="optional">
|
|
438
|
+
event
|
|
439
|
+
<span class="property-type">object</span>
|
|
440
|
+
</dt>
|
|
441
|
+
<dd>
|
|
442
|
+
Required when <code>action</code> is <code>send</code>. Provide a Responses client event,
|
|
443
|
+
currently <code>{ "type": "response.create", ... }</code>.
|
|
444
|
+
</dd>
|
|
445
|
+
|
|
446
|
+
<dt class="optional">
|
|
447
|
+
code
|
|
448
|
+
<span class="property-type">integer</span>
|
|
449
|
+
</dt>
|
|
450
|
+
<dd>
|
|
451
|
+
Optional websocket close code used when <code>action</code> is <code>close</code>.
|
|
452
|
+
Defaults to <code>1000</code>.
|
|
453
|
+
</dd>
|
|
454
|
+
|
|
455
|
+
<dt class="optional">
|
|
456
|
+
reason
|
|
457
|
+
<span class="property-type">string</span>
|
|
458
|
+
</dt>
|
|
459
|
+
<dd>
|
|
460
|
+
Optional websocket close reason used when <code>action</code> is <code>close</code>.
|
|
461
|
+
Defaults to <code>OK</code>.
|
|
462
|
+
</dd>
|
|
463
|
+
|
|
464
|
+
</dl>
|
|
465
|
+
<p>
|
|
466
|
+
The websocket URL is derived from the configured <code>Service Host</code> API Base using the
|
|
467
|
+
same auth contract as the rest of this node, including custom auth headers and query-string auth.
|
|
468
|
+
</p>
|
|
469
|
+
|
|
389
470
|
</details>
|
|
390
471
|
</section>
|