Categories

Versions

Send Prompt (OpenAI) (Generative Models)

Synopsis

Generates a new column from LLM results using OpenAI

Description

This operator sends prompts to OpenAI (ChatGPT, a different OpenAI model or even a finetuned variant of their models). The results will be stored in a new column of the input data table. The prompts can refer to the values in one or several other columns by using the format [[column_name]]. Please note that you will need an account with OpenAI and an API key which you will need to provide as a Dictionary Connection as the second operator input. You may also need to buy credits since OpenAI only allows a few queries for free. You can select one of the models or simply enter the model ID of a model that you have finetuned yourself.

Input

  • data (Data table)

    The data which will be injected into your prompt template. You can refer to columns of the data with [[column_name]] in the prompt.

  • connection (Connection)

    A Dictionary Connection with only one key-value-pair with the key being 'api_key' and the value a valid OpenAI API key.

Output

  • data (Data table)

    The resulting data set where the prompt results are added as a new column to the input data.

  • connection (Connection)

    The input connection.

Parameters

  • model Select a model which should be used for this application. You can type also the model ID of a previously finetuned model instead.
  • name The name of the new column which will be created as a result.
  • prompt The prompt used for querying the model. Please note that you can reference the values of any of the input data columns with [[column_name]].
  • max target tokens The maximum number of tokens which will be generated by the model.
  • system prompt A system prompt which can be used to initialize the model or embody a specific persona.
  • temperature Controls the randomness used in the answers. Lower values will lead to less random answers. A temperature of 0 represents a fully deterministic model behavior.
  • top p Controls diversity via nucleus sampling. A value of 0.5 means that half of all likelihood-weighted options would be considered.
  • frequency penalty How much to penalize new tokens based on their frequency in the answer so far.
  • presence penalty How much to penalize new tokens based on their presence in the answer so far. Increases the model's likeliness to talk about new topics.
  • conda environment The conda environment used for this downloading task. Additional packages may be installed into this environment, please refer to the extension documentation for additional details on this and on version requirements for Python and some packages which have be present in this environment.

Tutorial Processes

Send Prompts to Open AI for Data Enrichment

This process simply generates a data set with five countries in a column called Country. It then asks ChatGPT for the capitals for the countries which are added as an additional column. IMPORTANT: you will need an account with OpenAI and provide your own API key as a Dictionary Connection to make this tutorial process work.