UNPKG

@inductiv/node-red-openai-api

Version:

Enhance your Node-RED projects with advanced AI capabilities.

248 lines (216 loc) 13 kB
<section> <details> <summary style="font-weight: bold;">🗨️ Responses</summary> <a href="https://platform.openai.com/docs/api-reference/responses" target="_blank">Official Documentation <i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <h4 style="font-weight: bolder;"> ⋙ Create Model Response</h4> <p>Creates a model response.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> input <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-input" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string | array</span> </dt> <dd>Text, image, or file inputs to the model, used to generate a response.</dd> <dt> model <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-model" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>Model ID used to generate the response.</dd> <dt class="optional"> include <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-include" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">array</span> </dt> <dd>Specify additional output data to include in the model response.</dd> <dt class="optional"> instructions <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-instructions" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>Inserts a system (or developer) message as the first item in the model's context.</dd> <dt class="optional"> max_output_tokens <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-max_output_tokens" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">integer</span> </dt> <dd>An upper bound for the number of tokens that can be generated for a response.</dd> <dt class="optional"> metadata <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-metadata" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">object</span> </dt> <dd>Set of 16 key-value pairs that can be attached to an object.</dd> <dt class="optional"> parallel_tool_calls <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-parallel_tool_calls" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">boolean</span> </dt> <dd>Whether to allow the model to run tool calls in parallel.</dd> <dt class="optional"> parallel_tool_calls <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-parallel_tool_calls" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">boolean</span> </dt> <dd>Whether to allow the model to run tool calls in parallel.</dd> <dt class="optional"> previous_response_id <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-previous_response_id" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>The unique ID of the previous response to the model.</dd> <dt class="optional"> reasoning <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-reasoning" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">object</span> </dt> <dd>o-series models only. See official docs for option properties.</dd> <dt class="optional"> store <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-store" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">boolean</span> </dt> <dd>Whether to store the generated model response for later retrieval via API.</dd> <dt class="optional"> stream <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-stream" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">boolean</span> </dt> <dd>If set to true, the model response data will be streamed to the client as it is generated using server-sent events.</dd> <dt class="optional"> temperature <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-temperature" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">number</span> </dt> <dd>What sampling temperature to use, between 0 and 2.</dd> <dt class="optional"> text <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-text" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">object</span> </dt> <dd>Configuration options for a text response from the model.</dd> <dt class="optional"> tool_choice <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-tool_choice" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string or object</span> </dt> <dd>How the model should select which tool (or tools) to use when generating a response.</dd> <dt class="optional"> tools <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-tools" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">array</span> </dt> <dd> An array of tools the model may call while generating a response. For Model Context Protocol (MCP) tools, each object in the array should follow <a href="https://platform.openai.com/docs/guides/tools-remote-mcp?lang=javascript&utm_source==%40inductiv%2Fnode-red-openai-api" target="_blank">this structure</a>. </dd> <dt class="optional"> top_p <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-top_p" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">number</span> </dt> <dd>An alternative to sampling with temperature, called nucleus sampling.</dd> <dt class="optional"> truncation <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-truncation" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>The truncation strategy to use for the model response.</dd> <dt class="optional"> user <a href="https://platform.openai.com/docs/api-reference/responses/create#responses-create-user" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.</dd> </dl> <h4 style="font-weight: bolder;"> ⋙ Get Model Response</h4> <p>Retrieves a model response with the given ID.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> response_id <a href="https://platform.openai.com/docs/api-reference/responses/get#responses-get-response_id" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>The ID of the response to retrieve.</dd> </dl> <h4 style="font-weight: bolder;"> ⋙ Delete Model Response</h4> <p>Deletes a model response with the given ID.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> response_id <a href="https://platform.openai.com/docs/api-reference/responses/delete#responses-delete-response_id" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>The ID of the response to delete.</dd> </dl> <h4 style="font-weight: bolder;"> ⋙ List Input Items</h4> <p>Returns a list of input items for a given response.</p> <dl class="message-properties"> <h4>msg.payload Properties</h4> <dt> response_id <a href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-response_id" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>The ID of the response to retrieve input items for.</dd> <dt class="optional"> after <a href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-after" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>An item ID to list items after, used in pagination.</dd> <dt class="optional"> before <a href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-before" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>An item ID to list items before, used in pagination.</dd> <dt class="optional"> limit <a href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-limit" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">integer</span> </dt> <dd>A limit on the number of objects to be returned.</dd> <dt class="optional"> order <a href="https://platform.openai.com/docs/api-reference/responses/input-items#responses-input-items-order" target="_blank"><i class="fa fa-external-link fa-sm" aria-hidden="true"></i></a> <span class="property-type">string</span> </dt> <dd>The order to return the input items in. Default is <code>asc</code>.</dd> </dl> </details> </section>