Generate text using LLMs

Generate text from a large language model like GPT.

This key transformation is responsible for interacting with LLMs like GPT and Claude. It features a prompt box which allows you to configure a prompt and inject variables using the {{ }} syntax. It also allows you to select which model to use and configure its parameters such as temperature.

🚧

You must provide an API key

To use a model from a provider, you must have added an API key for that provider. If you do not, you'll get an error when running the prompt.

Screenshot of the transformation in the Relevance AI Notebook

Screenshot of the LLM transformation in the Notebook

Common errors

  • Missing API key
  • Prompt length exceeds maximum supports by model
  • Rate-limited by the model provider

Schema

Inputs

NameDescriptionTypeRequired
Prompt textThe prompt that will be sent to the LLM for completionStringβœ…
ModelThe large language model to use for completionEnumβœ…
TemperatureThe temperature to specify to the LLMNumber❌
HistoryAn array of objects to pass in as history for chat-based completions. Syntax is { role: 'user', message: 'hello world' }Array❌

Outputs

NameDescriptionType
PromptThe prompt that was sent to the LLM with variable substitutionString
AnsweThe completion returned by the LLMString