CREATE ML_ENGINE
and CREATE MODEL
statement to bring the OpenAI models to MindsDB.
We first create the openai engine by providing the openai_api_key:
Expressions | Values |
---|---|
project_name | mindsdb |
predictor_name | sentiment_classifier |
target_column | sentiment |
engine | openai |
prompt_template | predict the sentiment of the text:{{review}} exactly as either positive or negative or neutral |
prompt_template
parameter, we use a placeholder for a text value that
comes from the review
column, that is, text:{{ review }}
.sentiment_classifier
model.
complete
, we can query for predictions.
example_db
database before using one of its tables, like in the query above.sentiment_classifier
model.
complete
, we can query for a single prediction.
mongo_test_db
database connected earlier in this example.