Skip to content

Commit 7d964b2

Browse files
committed
Implemented listInputItems method.
1 parent 2c4bb7c commit 7d964b2

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

lib.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,14 @@ let OpenaiApi = (function () {
538538
return response;
539539
}
540540

541+
async listInputItems(parameters) {
542+
const openai = new OpenAI(this.clientParams);
543+
const { response_id, ...params } = parameters.payload;
544+
const list = await openai.responses.inputItems.list(response_id, params);
545+
546+
return [...list.data];
547+
}
548+
541549
// <<< End Responses functions
542550

543551
async createModeration(parameters) {

locales/en-US/node.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"createModelResponse": "create model response",
103103
"getModelResponse": "retrieve model response",
104104
"deleteModelResponse": "delete model response",
105+
"listInputItems": "list input items",
105106
"listAssistants": "list assistants",
106107
"order": "order",
107108
"before": "before",

node.html

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@
305305
data-i18n="OpenaiApi.parameters.deleteModelResponse"
306306
></option>
307307

308+
<option
309+
value="listInputItems"
310+
data-i18n="OpenaiApi.parameters.listInputItems"
311+
></option>
312+
308313
</optgroup>
309314
<optgroup style="font-style: normal;" label="🔄 Runs (Beta)">
310315
<option
@@ -3191,6 +3196,68 @@ <h4>msg.payload Properties</h4>
31913196
</dt>
31923197
<dd>The ID of the response to delete.</dd>
31933198
</dl>
3199+
3200+
<h4 style="font-weight: bolder;"> ⋙ List Input Items</h4>
3201+
<p>Returns a list of input items for a given response.</p>
3202+
<dl class="message-properties">
3203+
<h4>msg.payload Properties</h4>
3204+
3205+
<dt>
3206+
response_id
3207+
<a
3208+
href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-response_id"
3209+
target="_blank"
3210+
><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
3211+
></a>
3212+
<span class="property-type">string</span>
3213+
</dt>
3214+
<dd>The ID of the response to retrieve input items for.</dd>
3215+
3216+
<dt class="optional">
3217+
after
3218+
<a
3219+
href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-after"
3220+
target="_blank"
3221+
><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
3222+
></a>
3223+
<span class="property-type">string</span>
3224+
</dt>
3225+
<dd>An item ID to list items after, used in pagination.</dd>
3226+
3227+
<dt class="optional">
3228+
before
3229+
<a
3230+
href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-before"
3231+
target="_blank"
3232+
><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
3233+
></a>
3234+
<span class="property-type">string</span>
3235+
</dt>
3236+
<dd>An item ID to list items before, used in pagination.</dd>
3237+
3238+
<dt class="optional">
3239+
limit
3240+
<a
3241+
href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-limit"
3242+
target="_blank"
3243+
><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
3244+
></a>
3245+
<span class="property-type">integer</span>
3246+
</dt>
3247+
<dd>A limit on the number of objects to be returned.</dd>
3248+
3249+
<dt class="optional">
3250+
order
3251+
<a
3252+
href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-order"
3253+
target="_blank"
3254+
><i class="fa fa-external-link fa-sm" aria-hidden="true"></i
3255+
></a>
3256+
<span class="property-type">string</span>
3257+
</dt>
3258+
<dd>The order to return the input items in. Default is <code>asc</code>.</dd>
3259+
3260+
</dl>
31943261

31953262
</details>
31963263
</section>

0 commit comments

Comments
 (0)