Functions
The LLM() Function
MindsDB provides the LLM()
function that lets users incorporate the LLM-generated output directly into the data queries.
Prerequisites
The LLM()
function uses one of the OpenAI models and requires the OpenAI API key.
To use the LLM()
function with MindsDB, define the model to be used and the OpenAI API key as environment variables.
- The
LLM_FUNCTION_MODEL
environment variable should store the OpenAI model name, likegpt-4
. - The
OPENAI_API_KEY
environment variable should store the OpenAI API key value.
Usage
You can use the LLM()
function to simply ask a question and get an answer.
Here is the output:
Moreover, you can the LLM()
function with your data to swiftly complete tasks such as text generation or summarization.
Here is the output:
Was this page helpful?