@inductiv/node-red-openai-api 1.103.0 → 6.22.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 +165 -95
- package/examples/responses/mcp.json +1 -1
- package/lib.js +7035 -13298
- package/locales/en-US/node.json +49 -1
- package/node.html +1526 -981
- package/node.js +194 -54
- package/package.json +8 -7
- package/src/assistants/help.html +1 -77
- package/src/audio/help.html +1 -37
- package/src/batch/help.html +3 -17
- package/src/chat/help.html +11 -89
- package/src/container-files/help.html +1 -27
- package/src/containers/help.html +8 -18
- package/src/conversations/help.html +135 -0
- package/src/conversations/methods.js +73 -0
- package/src/conversations/template.html +10 -0
- package/src/embeddings/help.html +1 -11
- package/src/evals/help.html +249 -0
- package/src/evals/methods.js +114 -0
- package/src/evals/template.html +14 -0
- package/src/files/help.html +4 -17
- package/src/fine-tuning/help.html +1 -35
- package/src/images/help.html +1 -45
- package/src/lib.js +53 -1
- package/src/messages/help.html +19 -39
- package/src/messages/methods.js +13 -0
- package/src/messages/template.html +7 -18
- package/src/models/help.html +1 -5
- package/src/moderations/help.html +1 -5
- package/src/node.html +126 -37
- package/src/realtime/help.html +129 -0
- package/src/realtime/methods.js +45 -0
- package/src/realtime/template.html +7 -0
- package/src/responses/help.html +203 -61
- package/src/responses/methods.js +49 -16
- package/src/responses/template.html +16 -1
- package/src/runs/help.html +1 -123
- package/src/skills/help.html +183 -0
- package/src/skills/methods.js +99 -0
- package/src/skills/template.html +13 -0
- package/src/threads/help.html +1 -15
- package/src/uploads/help.html +1 -21
- package/src/vector-store-file-batches/help.html +1 -27
- package/src/vector-store-file-batches/methods.js +5 -5
- package/src/vector-store-files/help.html +1 -25
- package/src/vector-store-files/methods.js +4 -7
- package/src/vector-stores/help.html +2 -31
- package/src/vector-stores/methods.js +5 -11
- package/src/vector-stores/template.html +7 -22
- package/src/videos/help.html +113 -0
- package/src/videos/methods.js +50 -0
- package/src/videos/template.html +8 -0
- package/src/webhooks/help.html +61 -0
- package/src/webhooks/methods.js +40 -0
- package/src/webhooks/template.html +4 -0
- package/test/openai-methods-mapping.test.js +1220 -0
- package/test/openai-node-auth-routing.test.js +203 -0
- package/test/service-host-editor-template.test.js +53 -0
- package/test/service-host-node.test.js +182 -0
- package/test/services.test.js +147 -0
- package/test/utils.test.js +75 -0
package/node.js
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const OpenaiApi = require("./lib.js");
|
|
3
3
|
|
|
4
|
+
function resolveApiKeyType(config, credentials) {
|
|
5
|
+
return config.secureApiKeyValueType || credentials.secureApiKeyValueType || "cred";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function resolveApiKeyValue(config, credentials, apiKeyType) {
|
|
9
|
+
if (apiKeyType === "cred") {
|
|
10
|
+
return credentials.secureApiKeyValue;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const apiKeyRef = config.secureApiKeyValueRef;
|
|
14
|
+
if (typeof apiKeyRef === "string" && apiKeyRef.trim() !== "") {
|
|
15
|
+
return apiKeyRef;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (apiKeyRef !== undefined && apiKeyRef !== null && apiKeyRef !== "") {
|
|
19
|
+
return apiKeyRef;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return credentials.secureApiKeyValue;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function normalizeApiKeyHeaderOrQueryName(headerOrQueryName) {
|
|
26
|
+
if (typeof headerOrQueryName !== "string") {
|
|
27
|
+
return "Authorization";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const trimmedHeaderOrQueryName = headerOrQueryName.trim();
|
|
31
|
+
return trimmedHeaderOrQueryName || "Authorization";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function resolveApiKeyQueryMode(isQueryValue) {
|
|
35
|
+
return isQueryValue === true || isQueryValue === "true";
|
|
36
|
+
}
|
|
37
|
+
|
|
4
38
|
module.exports = function (RED) {
|
|
5
39
|
class OpenaiApiNode {
|
|
6
40
|
constructor(config) {
|
|
@@ -11,65 +45,104 @@ module.exports = function (RED) {
|
|
|
11
45
|
node.config = config;
|
|
12
46
|
|
|
13
47
|
node.on("input", function (msg) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
let client = new OpenaiApi(
|
|
19
|
-
clientApiKey,
|
|
20
|
-
clientApiBase,
|
|
21
|
-
clientOrganization
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
let payload;
|
|
25
|
-
|
|
26
|
-
const propertyType = node.config.propertyType || "msg";
|
|
27
|
-
const propertyPath = node.config.property || "payload";
|
|
28
|
-
|
|
29
|
-
if (propertyType === "msg") {
|
|
30
|
-
payload = RED.util.getMessageProperty(msg, propertyPath);
|
|
31
|
-
} else {
|
|
32
|
-
// For flow and global contexts
|
|
33
|
-
payload = node.context()[propertyType].get(propertyPath);
|
|
48
|
+
if (!node.service) {
|
|
49
|
+
node.error("OpenAI service host is not configured", msg);
|
|
50
|
+
return;
|
|
34
51
|
}
|
|
35
52
|
|
|
36
|
-
|
|
53
|
+
Promise.all([
|
|
54
|
+
node.service.evaluateTypedAsync("secureApiKeyValue", msg, node),
|
|
55
|
+
node.service.evaluateTypedAsync("apiBase", msg, node),
|
|
56
|
+
node.service.evaluateTypedAsync("organizationId", msg, node),
|
|
57
|
+
node.service.evaluateTypedAsync(
|
|
58
|
+
"secureApiKeyHeaderOrQueryName",
|
|
59
|
+
msg,
|
|
60
|
+
node
|
|
61
|
+
),
|
|
62
|
+
])
|
|
63
|
+
.then(
|
|
64
|
+
([
|
|
65
|
+
clientApiKey,
|
|
66
|
+
clientApiBase,
|
|
67
|
+
clientOrganization,
|
|
68
|
+
clientApiKeyHeaderOrQueryName,
|
|
69
|
+
]) => {
|
|
70
|
+
if (!clientApiKey) {
|
|
71
|
+
node.error("OpenAI API key is not configured", msg);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
37
74
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
75
|
+
const resolvedApiKeyHeaderOrQueryName =
|
|
76
|
+
normalizeApiKeyHeaderOrQueryName(clientApiKeyHeaderOrQueryName);
|
|
77
|
+
const apiKeyIsQuery = resolveApiKeyQueryMode(
|
|
78
|
+
node.service.secureApiKeyIsQuery
|
|
79
|
+
);
|
|
43
80
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
81
|
+
let client = new OpenaiApi(
|
|
82
|
+
clientApiKey,
|
|
83
|
+
clientApiBase,
|
|
84
|
+
clientOrganization,
|
|
85
|
+
{
|
|
86
|
+
headerOrQueryName: resolvedApiKeyHeaderOrQueryName,
|
|
87
|
+
isQuery: apiKeyIsQuery,
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
let payload;
|
|
92
|
+
|
|
93
|
+
const propertyType = node.config.propertyType || "msg";
|
|
94
|
+
const propertyPath = node.config.property || "payload";
|
|
51
95
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
node.send(msg);
|
|
58
|
-
node.status({});
|
|
96
|
+
if (propertyType === "msg") {
|
|
97
|
+
payload = RED.util.getMessageProperty(msg, propertyPath);
|
|
98
|
+
} else {
|
|
99
|
+
// For flow and global contexts
|
|
100
|
+
payload = node.context()[propertyType].get(propertyPath);
|
|
59
101
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
102
|
+
|
|
103
|
+
const serviceName = node.config.method; // Set the service name to call.
|
|
104
|
+
|
|
105
|
+
let serviceParametersObject = {
|
|
106
|
+
_node: node,
|
|
107
|
+
payload: payload,
|
|
108
|
+
msg: msg,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
// Dynamically call the function based on the service name
|
|
112
|
+
if (typeof client[serviceName] === "function") {
|
|
113
|
+
node.status({
|
|
114
|
+
fill: "blue",
|
|
115
|
+
shape: "dot",
|
|
116
|
+
text: "OpenaiApi.status.requesting",
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
client[serviceName](serviceParametersObject)
|
|
120
|
+
.then((payload) => {
|
|
121
|
+
if (payload !== undefined) {
|
|
122
|
+
// Update `msg.payload` with the payload from the API response, then send resonse to client.
|
|
123
|
+
msg.payload = payload;
|
|
124
|
+
node.send(msg);
|
|
125
|
+
node.status({});
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
.catch(function (error) {
|
|
129
|
+
node.status({
|
|
130
|
+
fill: "red",
|
|
131
|
+
shape: "ring",
|
|
132
|
+
text: "node-red:common.status.error",
|
|
133
|
+
});
|
|
134
|
+
let errorMessage = error.message;
|
|
135
|
+
node.error(errorMessage, msg);
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
console.error(`Function ${serviceName} does not exist on client.`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
.catch((error) => {
|
|
143
|
+
const errorMessage = error instanceof Error ? error.message : error;
|
|
144
|
+
node.error(errorMessage, msg);
|
|
145
|
+
});
|
|
73
146
|
});
|
|
74
147
|
}
|
|
75
148
|
}
|
|
@@ -79,11 +152,78 @@ module.exports = function (RED) {
|
|
|
79
152
|
constructor(n) {
|
|
80
153
|
RED.nodes.createNode(this, n);
|
|
81
154
|
|
|
82
|
-
this.secureApiKeyValue = n.secureApiKeyValue;
|
|
83
155
|
this.apiBase = n.apiBase;
|
|
84
156
|
this.secureApiKeyHeaderOrQueryName = n.secureApiKeyHeaderOrQueryName;
|
|
85
157
|
this.secureApiKeyIsQuery = n.secureApiKeyIsQuery;
|
|
86
158
|
this.organizationId = n.organizationId;
|
|
159
|
+
|
|
160
|
+
const creds = this.credentials || {};
|
|
161
|
+
const apiKeyType = resolveApiKeyType(n, creds);
|
|
162
|
+
const apiKeyValue = resolveApiKeyValue(n, creds, apiKeyType);
|
|
163
|
+
|
|
164
|
+
this.typedConfig = {
|
|
165
|
+
apiBase: { value: n.apiBase, type: n.apiBaseType || "str" },
|
|
166
|
+
secureApiKeyHeaderOrQueryName: {
|
|
167
|
+
value: n.secureApiKeyHeaderOrQueryName,
|
|
168
|
+
type: n.secureApiKeyHeaderOrQueryNameType || "str",
|
|
169
|
+
},
|
|
170
|
+
secureApiKeyValue: {
|
|
171
|
+
value: apiKeyValue,
|
|
172
|
+
type: apiKeyType,
|
|
173
|
+
},
|
|
174
|
+
organizationId: {
|
|
175
|
+
value: n.organizationId,
|
|
176
|
+
type: n.organizationIdType || "str",
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Helper to resolve property value at runtime
|
|
182
|
+
evaluateTyped(prop, msg, node) {
|
|
183
|
+
const entry = this.typedConfig[prop];
|
|
184
|
+
if (!entry) {
|
|
185
|
+
return undefined;
|
|
186
|
+
}
|
|
187
|
+
return RED.util.evaluateNodeProperty(
|
|
188
|
+
entry.value,
|
|
189
|
+
entry.type || "str",
|
|
190
|
+
node || this,
|
|
191
|
+
msg
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
evaluateTypedAsync(prop, msg, node) {
|
|
196
|
+
const entry = this.typedConfig[prop];
|
|
197
|
+
if (!entry) {
|
|
198
|
+
return Promise.resolve(undefined);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if (entry.type === "flow" || entry.type === "global") {
|
|
202
|
+
return new Promise((resolve, reject) => {
|
|
203
|
+
RED.util.evaluateNodeProperty(
|
|
204
|
+
entry.value,
|
|
205
|
+
entry.type || "str",
|
|
206
|
+
node || this,
|
|
207
|
+
msg,
|
|
208
|
+
(error, value) => {
|
|
209
|
+
if (error) {
|
|
210
|
+
reject(error);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
resolve(value);
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return Promise.resolve(
|
|
220
|
+
RED.util.evaluateNodeProperty(
|
|
221
|
+
entry.value,
|
|
222
|
+
entry.type || "str",
|
|
223
|
+
node || this,
|
|
224
|
+
msg
|
|
225
|
+
)
|
|
226
|
+
);
|
|
87
227
|
}
|
|
88
228
|
}
|
|
89
229
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inductiv/node-red-openai-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.22.0",
|
|
4
4
|
"description": "Enhance your Node-RED projects with advanced AI capabilities.",
|
|
5
5
|
"main": "node.js",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=18.0.0"
|
|
8
8
|
},
|
|
9
9
|
"node-red": {
|
|
10
|
-
"version": ">=
|
|
10
|
+
"version": ">=3.0.0",
|
|
11
11
|
"nodes": {
|
|
12
12
|
"openai": "node.js"
|
|
13
13
|
}
|
|
@@ -33,10 +33,11 @@
|
|
|
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
37
|
"prepare": "npm run build"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"openai": "^
|
|
40
|
+
"openai": "^6.22.0"
|
|
40
41
|
},
|
|
41
42
|
"author": "Allan Bunch",
|
|
42
43
|
"license": "MIT",
|
|
@@ -45,8 +46,8 @@
|
|
|
45
46
|
"url": "git+https://github.com/allanbunch/node-red-openai-api.git"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"esbuild": "^0.
|
|
49
|
-
"gulp": "^5.0.
|
|
49
|
+
"esbuild": "^0.27.0",
|
|
50
|
+
"gulp": "^5.0.1",
|
|
50
51
|
"gulp-file-include": "^2.3.0"
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
|
+
}
|
package/src/assistants/help.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<section>
|
|
2
2
|
<details>
|
|
3
3
|
<summary style="font-weight: bold;">🤖 Assistants</summary>
|
|
4
|
-
<a href="https://
|
|
4
|
+
<a href="https://developers.openai.com/api/reference/typescript/resources/beta/assistants/" target="_blank">Official Documentation
|
|
5
5
|
<i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
6
6
|
<h4 style="font-weight: bolder;"> ⋙ Create Assistant</h4>
|
|
7
7
|
<p>Create an assistant with a model and instructions.</p>
|
|
@@ -10,60 +10,44 @@
|
|
|
10
10
|
|
|
11
11
|
<dt>
|
|
12
12
|
model
|
|
13
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-model"
|
|
14
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
15
13
|
<span class="property-type">string</span>
|
|
16
14
|
</dt>
|
|
17
15
|
<dd>ID of the model to use.</dd>
|
|
18
16
|
<dt class="optional">
|
|
19
17
|
name
|
|
20
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-name"
|
|
21
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
22
18
|
<span class="property-type">string</span>
|
|
23
19
|
</dt>
|
|
24
20
|
<dd>The name of the assistant.</dd>
|
|
25
21
|
<dt class="optional">
|
|
26
22
|
description
|
|
27
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-description"
|
|
28
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
29
23
|
<span class="property-type">string</span>
|
|
30
24
|
</dt>
|
|
31
25
|
<dd>The description of the assistant.</dd>
|
|
32
26
|
<dt class="optional">
|
|
33
27
|
instructions
|
|
34
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-instructions"
|
|
35
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
36
28
|
<span class="property-type">string</span>
|
|
37
29
|
</dt>
|
|
38
30
|
<dd>The system instructions that the assistant uses.</dd>
|
|
39
31
|
<dt class="optional">
|
|
40
32
|
tools
|
|
41
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-tools"
|
|
42
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
43
33
|
<span class="property-type">array</span>
|
|
44
34
|
</dt>
|
|
45
35
|
<dd>A list of tool enabled on the assistant.</dd>
|
|
46
36
|
|
|
47
37
|
<dt class="optional">
|
|
48
38
|
tool_resources
|
|
49
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-tool_resources"
|
|
50
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
51
39
|
<span class="property-type">object</span>
|
|
52
40
|
</dt>
|
|
53
41
|
<dd>A set of resources that are used by the assistant's tools. </dd>
|
|
54
42
|
|
|
55
43
|
<dt class="optional">
|
|
56
44
|
metadata
|
|
57
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-metadata"
|
|
58
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
59
45
|
<span class="property-type">object</span>
|
|
60
46
|
</dt>
|
|
61
47
|
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
|
|
62
48
|
|
|
63
49
|
<dt class="optional">
|
|
64
50
|
temperature
|
|
65
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-temperature"
|
|
66
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
67
51
|
<span class="property-type">number</span>
|
|
68
52
|
</dt>
|
|
69
53
|
<dd>What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more
|
|
@@ -71,8 +55,6 @@
|
|
|
71
55
|
|
|
72
56
|
<dt class="optional">
|
|
73
57
|
top_p
|
|
74
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-top_p"
|
|
75
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
76
58
|
<span class="property-type">number</span>
|
|
77
59
|
</dt>
|
|
78
60
|
<dd>An alternative to sampling with temperature, called nucleus sampling, where the model considers the
|
|
@@ -80,8 +62,6 @@
|
|
|
80
62
|
|
|
81
63
|
<dt class="optional">
|
|
82
64
|
response_format
|
|
83
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistant#assistants-createassistant-response_format"
|
|
84
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
85
65
|
<span class="property-type">string</span>
|
|
86
66
|
</dt>
|
|
87
67
|
<dd>Specifies the format that the model must output.</dd>
|
|
@@ -95,8 +75,6 @@
|
|
|
95
75
|
|
|
96
76
|
<dt>
|
|
97
77
|
assistant_id
|
|
98
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/getAssistant#assistants-getassistant-assistant_id"
|
|
99
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
100
78
|
<span class="property-type">string</span>
|
|
101
79
|
</dt>
|
|
102
80
|
<dd>The ID of the assistant to retrieve.</dd>
|
|
@@ -109,68 +87,50 @@
|
|
|
109
87
|
|
|
110
88
|
<dt>
|
|
111
89
|
assistant_id
|
|
112
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-assistant_id"
|
|
113
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
114
90
|
<span class="property-type">string</span>
|
|
115
91
|
</dt>
|
|
116
92
|
<dd>The ID of the assistant to retrieve.</dd>
|
|
117
93
|
|
|
118
94
|
<dt class="optional">
|
|
119
95
|
model
|
|
120
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-model"
|
|
121
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
122
96
|
<span class="property-type">string</span>
|
|
123
97
|
</dt>
|
|
124
98
|
<dd>ID of the model to use.</dd>
|
|
125
99
|
<dt class="optional">
|
|
126
100
|
name
|
|
127
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-name"
|
|
128
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
129
101
|
<span class="property-type">string</span>
|
|
130
102
|
</dt>
|
|
131
103
|
<dd>The name of the assistant.</dd>
|
|
132
104
|
<dt class="optional">
|
|
133
105
|
description
|
|
134
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-description"
|
|
135
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
136
106
|
<span class="property-type">string</span>
|
|
137
107
|
</dt>
|
|
138
108
|
<dd>The description of the assistant.</dd>
|
|
139
109
|
<dt class="optional">
|
|
140
110
|
instructions
|
|
141
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-instructions"
|
|
142
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
143
111
|
<span class="property-type">string</span>
|
|
144
112
|
</dt>
|
|
145
113
|
<dd>The system instructions that the assistant uses.</dd>
|
|
146
114
|
<dt class="optional">
|
|
147
115
|
tools
|
|
148
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-tools"
|
|
149
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
150
116
|
<span class="property-type">array</span>
|
|
151
117
|
</dt>
|
|
152
118
|
<dd>A list of tool enabled on the assistant.</dd>
|
|
153
119
|
|
|
154
120
|
<dt class="optional">
|
|
155
121
|
tool_resources
|
|
156
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-tool_resources"
|
|
157
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
158
122
|
<span class="property-type">object</span>
|
|
159
123
|
</dt>
|
|
160
124
|
<dd>A set of resources that are used by the assistant's tools. </dd>
|
|
161
125
|
|
|
162
126
|
<dt class="optional">
|
|
163
127
|
metadata
|
|
164
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-metadata"
|
|
165
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
166
128
|
<span class="property-type">object</span>
|
|
167
129
|
</dt>
|
|
168
130
|
<dd>Set of 16 key-value pairs that can be attached to an object.</dd>
|
|
169
131
|
|
|
170
132
|
<dt class="optional">
|
|
171
133
|
temperature
|
|
172
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-temperature"
|
|
173
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
174
134
|
<span class="property-type">number</span>
|
|
175
135
|
</dt>
|
|
176
136
|
<dd>What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more
|
|
@@ -178,8 +138,6 @@
|
|
|
178
138
|
|
|
179
139
|
<dt class="optional">
|
|
180
140
|
top_p
|
|
181
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-top_p"
|
|
182
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
183
141
|
<span class="property-type">number</span>
|
|
184
142
|
</dt>
|
|
185
143
|
<dd>An alternative to sampling with temperature, called nucleus sampling, where the model considers the
|
|
@@ -187,8 +145,6 @@
|
|
|
187
145
|
|
|
188
146
|
<dt class="optional">
|
|
189
147
|
response_format
|
|
190
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/modifyAssistant#assistants-modifyassistant-response_format"
|
|
191
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
192
148
|
<span class="property-type">string</span>
|
|
193
149
|
</dt>
|
|
194
150
|
<dd>Specifies the format that the model must output.</dd>
|
|
@@ -202,8 +158,6 @@
|
|
|
202
158
|
|
|
203
159
|
<dt>
|
|
204
160
|
assistant_id
|
|
205
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/deleteAssistant#assistants-deleteassistant-assistant_id"
|
|
206
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
207
161
|
<span class="property-type">string</span>
|
|
208
162
|
</dt>
|
|
209
163
|
<dd>The ID of the assistant to delete.</dd>
|
|
@@ -215,29 +169,21 @@
|
|
|
215
169
|
<h4>msg.payload Properties</h4>
|
|
216
170
|
<dt class="optional">
|
|
217
171
|
limit
|
|
218
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-limit"
|
|
219
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
220
172
|
<span class="property-type">integer</span>
|
|
221
173
|
</dt>
|
|
222
174
|
<dd>A limit on the number of objects to be returned.</dd>
|
|
223
175
|
<dt class="optional">
|
|
224
176
|
order
|
|
225
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-order"
|
|
226
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
227
177
|
<span class="property-type">string</span>
|
|
228
178
|
</dt>
|
|
229
179
|
<dd>Sort order by the created_at timestamp of the objects.</dd>
|
|
230
180
|
<dt class="optional">
|
|
231
181
|
after
|
|
232
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-after"
|
|
233
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
234
182
|
<span class="property-type">string</span>
|
|
235
183
|
</dt>
|
|
236
184
|
<dd>A cursor for use in pagination.</dd>
|
|
237
185
|
<dt class="optional">
|
|
238
186
|
before
|
|
239
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistants#assistants-listassistants-before"
|
|
240
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
241
187
|
<span class="property-type">string</span>
|
|
242
188
|
</dt>
|
|
243
189
|
<dd>A cursor for use in pagination.</dd>
|
|
@@ -250,36 +196,26 @@
|
|
|
250
196
|
|
|
251
197
|
<dt>
|
|
252
198
|
assistant_id
|
|
253
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-assistant_id"
|
|
254
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
255
199
|
<span class="property-type">string</span>
|
|
256
200
|
</dt>
|
|
257
201
|
<dd>The ID of the assistant the file belongs to.</dd>
|
|
258
202
|
<dt class="optional">
|
|
259
203
|
limit
|
|
260
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-limit"
|
|
261
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
262
204
|
<span class="property-type">integer</span>
|
|
263
205
|
</dt>
|
|
264
206
|
<dd>A limit on the number of objects to be returned.</dd>
|
|
265
207
|
<dt class="optional">
|
|
266
208
|
order
|
|
267
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-order"
|
|
268
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
269
209
|
<span class="property-type">string</span>
|
|
270
210
|
</dt>
|
|
271
211
|
<dd>Sort order by the created_at timestamp of the objects.</dd>
|
|
272
212
|
<dt class="optional">
|
|
273
213
|
after
|
|
274
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-after"
|
|
275
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
276
214
|
<span class="property-type">string</span>
|
|
277
215
|
</dt>
|
|
278
216
|
<dd>A cursor for use in pagination.</dd>
|
|
279
217
|
<dt class="optional">
|
|
280
218
|
before
|
|
281
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/listAssistantFiles#assistants-listassistantfiles-before"
|
|
282
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
283
219
|
<span class="property-type">string</span>
|
|
284
220
|
</dt>
|
|
285
221
|
<dd>A cursor for use in pagination.</dd>
|
|
@@ -292,15 +228,11 @@
|
|
|
292
228
|
|
|
293
229
|
<dt>
|
|
294
230
|
assistant_id
|
|
295
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistantFile#assistants-createassistantfile-assistant_id"
|
|
296
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
297
231
|
<span class="property-type">string</span>
|
|
298
232
|
</dt>
|
|
299
233
|
<dd>The ID of the assistant for which to create a File.</dd>
|
|
300
234
|
<dt>
|
|
301
235
|
file_id
|
|
302
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/createAssistantFile#assistants-createassistantfile-file_id"
|
|
303
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
304
236
|
<span class="property-type">string</span>
|
|
305
237
|
</dt>
|
|
306
238
|
<dd>
|
|
@@ -315,15 +247,11 @@
|
|
|
315
247
|
|
|
316
248
|
<dt>
|
|
317
249
|
assistant_id
|
|
318
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/getAssistantFile#assistants-getassistantfile-assistant_id"
|
|
319
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
320
250
|
<span class="property-type">string</span>
|
|
321
251
|
</dt>
|
|
322
252
|
<dd>The ID of the assistant who the file belongs to.</dd>
|
|
323
253
|
<dt>
|
|
324
254
|
file_id
|
|
325
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/getAssistantFile#assistants-getassistantfile-file_id"
|
|
326
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
327
255
|
<span class="property-type">string</span>
|
|
328
256
|
</dt>
|
|
329
257
|
<dd>The ID of the file we're getting.</dd>
|
|
@@ -336,15 +264,11 @@
|
|
|
336
264
|
|
|
337
265
|
<dt>
|
|
338
266
|
assistant_id
|
|
339
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/deleteAssistantFile#assistants-deleteassistantfile-assistant_id"
|
|
340
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
341
267
|
<span class="property-type">string</span>
|
|
342
268
|
</dt>
|
|
343
269
|
<dd>The ID of the assistant that the file belongs to.</dd>
|
|
344
270
|
<dt>
|
|
345
271
|
file_id
|
|
346
|
-
<a href="https://platform.openai.com/docs/api-reference/assistants/deleteAssistantFile#assistants-deleteassistantfile-file_id"
|
|
347
|
-
target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a>
|
|
348
272
|
<span class="property-type">string</span>
|
|
349
273
|
</dt>
|
|
350
274
|
<dd>The ID of the file to delete.</dd>
|