Rule: OpenAI Custom Field (AI Interpolator OpenAI)
Base data:
Summary:
The custom module is a great module where you can setup not just complex data types, but combinations of them. This also gives the advantage that using this Interpolator you can ask for it answering all the things at the same time.
One simple example would be that you want it to rate a school text between 1-5. This could easily be done by the integer rule. Then you want to ask it why it set that rating. This could easily be done by one of the text rules.
The problem is that you have now done two queries, that costs extra money and they are not contextually connected. Since AI is not determenistic you might get rating 3 the first call and what would be rating 4 when it explains the rating.
With the Custom Field module you could create a field with both fields and ask for both in the same query/session.
When using an OpenAI vision model, you can also use the combination of prompt and image to get the response you want.
Module needed:
AI Interpolator OpenAI
Field types to populate:
Custom Field (contrib Custom Field module).
Base Fields types to use as context:
- Text (plain)
- Text (plain, long)
- Text (formatted)
- Text (formatted, long)
- Text (formatted, long, with summary)
Extra Requirements:
You need a paid OpenAI account with API access.
You need the Custom Field module installed.
Prompting tips:
The query for this in the background is actually extremely complex, but what is important is that you have a base query that explains all the things you want to do and then fill in the subqueries and examples also.
NOTE: After you have saved the data structure, you have to click edit again on the field to fill out the subqueries, since they are based on the field structure that is not known on creation.
Extra Settings:
None
Extra Advanced Settings:
(Per Field Type) Query
You need to fill out a simple description per field type, how this field type is filled out.
(Per Field Type) Example value
You have to give an example value of the field type. This is extremely important so the GPT gets some feeling of what is expected.
OpenAI Model
The model to use from OpenAI. Read more here about capabilities and more here about pricing. Only use GPT-4 with custom fields. GPT-3.5 will fail!!
OpenAI Vision Image
This only shows up if you choose a model that is capable of vision. When that is chosen you can choose an image field here to use as context for your query.
OpenAI Role
If there should be pre-context or understanding on who the GPT should be, please fill out the role here. Should be short if used.
OpenAI Moderation
This runs each query through OpenAI's moderation api. It makes sure that you do not send a query to OpenAI that breaks their content policy, which could leave to account cancellation. There is almost never any reason not to uncheck this, it is free. The only reason would be if you know what you are going to send does not break the content policy and you want to speed up multiple queries.
Possible example use cases:
- Rate a text in both numbers and with an explanation.
- Create a short and a long summary in the same query.
- Create complex paragraphs automatically without the paragraphs module.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion