Connect a data source
Configure an AI engine
Create and deploy an AI model
Query for predictions
CREATE DATABASE
statement to connect a data source to MindsDB.
CREATE ML_ENGINE
command to configure an AI engine. Here we use the OpenAI engine.
CREATE MODEL
statement to create, train, and deploy an AI model based on the AI engine created in step 2.
{{question}}
and {{article_title}}
as input, and generates answer
as output.
data_source
connection should be made using the CREATE DATABASE
statement to a data source with a user that has the write access.
This job creates the questions_answers
table inside the connected data source. This table is filled with questions from the input data table and answers generated by the AI table. Considering that new questions are added daily to the input data table, this job executes once a day.
Alternatively, you could use the LAST
keyword to fetch only the newly added questions to the input data table. That would enable you to insert new question-answer pairs into the questions_answers
table instead of recreating it. But to do that, the input data table must provide either a date/time or integer/float column that would be used in the condition like datetime > LAST
. Learn more about the LAST
keyword here.