Test OpenAI Language Model

OpenAI model for use with AI Agent - Test Version

Test OpenAI Language Model

AI-generated

Summary

Generate a text completion or JSON-schema-based response from an OpenAI model by providing a prompt and configuration parameters.

Inputs

  • Model (required) — Specify the OpenAI model used to generate the completion (default is 'gpt-4-turbo').
  • Temperature (required) — Set the randomness of the model's output, between 0 and 2 (default 0.7).
  • Response Format Type (required) — Choose the response format: plain 'Text' or structured 'JSON Schema'.
  • Schema Name — Name for the JSON schema if 'JSON Schema' response format is selected (default 'custom_schema').
  • JSON Schema — Define a JSON schema to structure the model's response when using the 'JSON Schema' format.

Output shape

a single AI language model completion string returned under 'ai_languageModel' output.

The output is the content of the OpenAI chat completion's first choice message. If JSON Schema format is used, the model response is formatted according to the provided schema. The node requires valid OpenAI API credentials. No pagination or multiple records.

Examples

Example 1: Request a text completion

Set Model to 'gpt-4-turbo', Temperature to 0.7, and Response Format Type to 'Text'. Provide a user prompt to generate text output.

Example 2: Request structured response

Set Response Format Type to 'JSON Schema', enter a Schema Name and JSON Schema to receive validated structured data from the model.

Discussion