WordPress Glossary Plugin (CMTG) - Use Case - How to Build Up Your Website Glossary Using Gemini
Use Case – How to Build Up Your Website Glossary Using Gemini
Note: This guide covers features from:
- WordPress Glossary plugin (Ecommerce edition) - This document uses version 4.3.10.
Video Use-Case
Introduction
The WordPress Glossary plugin allows you to create a site with a complete glossary of terms. Each term definition can appear on mouse hover across the whole site.
The Ecommerce version of the plugin allows to automatically generate definitions using third-party services - one of them is Gemini.
The plugin also supports the Double-click feature, so it is possible to generate a temporary definition for any word that the user double-clicks. The admin also has a possibility to permanently store these definitions to the glossary.
Use Case Front-End
Use Case Assumptions
In this example use case guide we will consider how to build up a glossary on your site using Gemini.
We consider that you have already bought the plugin, but not installed it yet.
It follows:
- Installing the plugin
- Quick recap
- What is Gemini
- How to get Gemini API
- Configuring Gemini integration
- Disabling Gemini definitions in specific terms
- Configuring Double-click support
- Regeneration of definitions
- End result
Installing the Plugin
The process is the same for all CM plugins and add-ons.
- Download the plugin from your customer dashboard.
- Log in to WordPress and navigate to the WordPress Admin → Plugins settings.
- Click on Add New.
- Activate it and add the license.
Learn more: Getting Started - Installation And First Steps
Quick Recap
In this use case we will cover only how to build up a glossary using Gemini and Double-click support. If you want learn more about how to configure the plugin and create your glossary, please, refer to this use case guide:
What is Gemini
Gemini, also known as Bard, is a friendly artificial intelligence chatbot created by Google. It is built on the large language model (LLM) of the same name and was developed as a direct response to the rapid growth of OpenAI's ChatGPT. Gemini was introduced in a limited capacity in March 2023 and later expanded to other countries in May. It was previously built on PaLM and initially belonged to the LaMDA family of large language models.
How to Get Gemini API
To integrate Gemini with WordPress Glossary plugin, you will need an API key. To obtain it, you need to sign up on the Google AI Studio site. You need to register and verify your phone number. After you are registered and logged-in, head to the API Keys to create and get the key.
Copy this key and keep it safe and secure, as it provides access to your account and services. The copied key will be needed while configuring the plugin.
Configuring Gemini Integration
Now we can configure the integration with the WordPress Glossary plugin. To do this, navigate to Admin Dashboard → CM Tooltip Glossary Ecommerce → Settings → Ecommerce Settings tab.
Scroll down and find the section Gemini. It has the following options:
Let's consider these options more detailed.
Enabling the Gemini Integration
First 3 options that we will consider are:
- Enabled - Check this option to enable the integration with Gemini.
- Gemini API Key - Enter here the API key which you obtained from the Google AI Studio site.
- Gemini Model - This option allows you to choose a Gemini model. This option is inactive until you enter your API key in the option above and save the changes. Once it's done, you will be able to choose any model supported by your API in the dropdown.
Example of Available Models
The Way Definitions Are Generated
The next group of options is about the way the definitions will be generated. These options allow you to specify the context of the generated terms, their length and precision.
- Gemini Prompt Template - Specify the request which the plugin will be sending to Gemini for getting the term definition. Important: this template must contain the placeholder {term}.
- Gemini Reply Length - Define the maximum length of the reply from Gemini. This affects the final length of the term.
- Gemini Temperature - This option allows to define how accurate the generated definition will be. This value ranges from 0 to 1. Lower temperatures are good for prompts that require a more deterministic and less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.
- Gemini Safety Level - The Gemini API blocks content based on the probability of content being unsafe. By default, safety settings block content (including prompts) with medium or higher probability of being unsafe across any dimension. You can change safety level to the one is appropriate for your use case:
- Always show regardless of probability of being harmful
- Block low, medium or high probability of being harmful
- Block medium or high probability of being harmful
- Block high probability of being harmful
Displaying Generated Definitions
And one more group of options that we will consider now is related to how the generated definitions will be displayed on the front-end:
- Only show Gemini when content is empty - Enable it, if you want the definition generated by Gemini to be added only in case if the term is empty (when you didn't add the definition manually). If the option is disabled, the Gemini definition will be displayed below the definition which you wrote by yourself.
- Display button to generate description by Gemini on the term page - If enabled, a button for generating a temporary Gemini definition will be displayed on each term page on the front-end. The generated definition will be stored in cache until it's cleared or until the button is clicked again while the definition is already displayed - in this case, the definition will be regenerated .This button can be disabled specifically for each term in the metabox CM Tooltip - Term Properties.
- Show Gemini data in Tooltip - Enable it, if you want the definition generated by Gemini to be displayed in tooltips.
- Show Gemini data in Glossary term display - Enable it, if you want the definition generated by Gemini to be displayed on the term page.
- Wrap the output from Gemini in custom HTML template - Enable it, if you want to wrap the definition generated by Gemini with custom HTML template. The template can be specified in the option Gemini Wrapper Template.
- Gemini Wrapper Template - Specify the custom template to wrap the definition generated by Gemini. The template accepts placeholders {term} as a requested term, and {content} as an obtained definition.
Example
Let's use the following HTML template:
<hr>Definition of <strong>{term}</strong> generated by Gemini: {content}
- With custom template
- Without custom template
Disabling Gemini Definitions In Specific Terms
You can override the general plugin settings for showing definitions generated by Gemini in specific terms. To do this, find the metabox CM Tooltip - Term Properties on the term editing page. There you can find 2 relevant options:
- Disable Gemini API for this term - If checked, then Gemini definitions will not be automatically generated and displayed on the term page and in the tooltip for this specific term.
- Disable Gemini button on the term page for this term - This option disables the front-end button for generating a temporary Gemini definition on the term page.
Configuring Double-click Support
The plugin supports a double-click feature with Gemini integration.
It means that every time a word is double-clicked anywhere on the page (even without being defined as a Glossary term), a temporary tooltip will be displayed, containing the definition generated by Gemini.
If somebody double-clicks some word, the definition generated by Gemini will be cached on your site. So the plugin will not request the definition for this word every time somebody double-clicks it, as the result is already stored on your site (until you flush the cache).
Front-end Example
The settings for enabling this feature are located under the same tab Ecommerce Settings.
Find the section Doubleclick settings:
Generating Temporary Definitions
To allow users using the double-click feature, you need to configure the following options:
- Enable doubleclick API call - Check it to turn on the double-click support.
- Doubleclick service - Open the dropdown and choose Gemini.
- Doubleclick underline color - Here you can define the underline color for a temporary definition which is generated by the Double-click feature. The color should be set in the hex format. For more complex styling you can use the selector:
.glossaryLink.temporary{//your styles here}
Storing Definitions To the Database
The Double-click feature also allows the admin to permanently save generated by Gemini definitions straight from the front-end. It's just enough to click the relevant button in the appearing tooltip, and the new term will be created in your glossary.
Front-end Example
To enable it, configure the following options:
- Enable saving the results as terms - Check this option to have the ability to save temporary generated terms to the glossary from the front-end.
- Doubleclick "Save" label - Here you can change the label for the Save button.
TIP
If you're planning to build your glossary using this method, we recommend you to enable the option Only show Gemini when content is empty in main Gemini Integration settings. This way, the Gemini definition will not be duplicated after storing the term to the database.
Regeneration of Definitions
By default, the plugin stores in the cache the automatically generated definitions. It allows not generating the definitions for already fetched terms every time, so the tokens will not be wasted for no reason and it makes the process faster. But you can regenerate the definitions if needed. Let's consider how and where you can do this.
Regeneration of the Temporary Definition
When the double-click support is enabled, the admin can regenerate temporary terms in the appearing tooltip by clicking the relevant button.
Front-end Example
To enable it, configure the following options:
- Enable saving the results as terms - When this option is enabled, it allows not only saving the terms to the database, but also regenerate them (before they're saved).
- Doubleclick "Regenerate" label - Here you can change the label for the Regenerate button.
Specific Term Regeneration
You can regenerate the definition by Gemini for specific existing terms. To do this, while editing the term, find the metabox CM Tooltip - Term Properties.
It has a long list of available options. At the bottom of the metabox, find and check the option Flush all API Caches for this term, then save the changes by clicking the button Update.
The Gemini definition will be regenerated for this term.
General Glossary Regeneration
To regenerate definitions generated by Gemini for all your glossary terms, get back to the Gemini integration settings. Find the button Flush cache and click it.
All Gemini definitions will be regenerated.
End Result
Following instructions found in the plugin and guides you should be able to build up a glossary on your site using Gemini.
Use Case Front-End
More information about the WordPress Glossary Plugin Other WordPress products can be found at CreativeMinds WordPress Store |
|
Let us know how we can Improve this Product Documentation Page To open a Support Ticket visit our support center |