Although this module is completely free, the AI it uses is not. The module requires an API key obtained from https://beta.openai.com/account/api-keys and an OpenAI account with valid payment information. The pricing can be found at https://openai.com/api/pricing/, but on average you can expect each non-custom request made by this module to cost about $0.002 (2/10th of a single cent). It is advised to set a monthly usage limit if you are worried about costs, you can do so in your account settings here https://beta.openai.com/account/billing/limits.
This module does not require any credentials except for your API key, which is stored locally in your Foundry settings. All billing is done from your OpenAI account. This key could be accessed by other programs and modules although they would have little reason to do so, nevertheless be careful and once again make sure to set a monthly limit to avoid unsuspected costs.
GPT-3 is a text-based AI by OpenAI. This module provides a user-friendly implentation to communicate with its API from within your Foundry games to generate descriptions on the fly.
By default your current rpg system is integrated into the prompt to give GPT-3 the context it needs. By the nature of GPT-3 it will work better for popular systems and worse for very niche systems. If your system produces subpar results you can manually change the system in the settings to something that provides more context than just the system's name.
By default your current FoundryVTT language is integrated into the prompt to encourage GPT-3 to reply in that language. GPT-3 was trained mainly in English so the quality of results may vary in other languages.
If you want to have some fun, try out Pirate Speech
.
There are two new commands available to the GM to send prompts to GPT-3.
/gpt construct (subject) [subjectType]
- Constructs and sends a prompt similar to the Description Generator.
- The prompt is based on your settings, the provided
subject
, and optionally asubjectType
(eithercreature
,item
, orspell
). - Examples:
/gpt construct Ancient White Dragon creature
/gpt construct Beholder
/gpt construct Fireball spell
/gpt send (prompt)
- Sends a custom
prompt
. - Examples:
/gpt send What does the Magic Missile spell do in dnd5e?
/gpt send What would be a fun low level encounter for a dnd5e game set in a jungle?
All actors, items, and spells have a button added in their header for the GM to request a short description generated by the AI based on your rpg system and world/setting. Responses are put in the Foundry chat and can optionally only be whispered to you.
Adult Green Dragon
Air Elemental
Will O' Wisp
Alchemy Jug
Bag of Holding
Flame Tongue Greatsword
Cone of Cold
Eldritch Blast
Fireball
Please report issues and propose feature requests here.
The module will never send a request to GPT-3 without being told to by pressing a button, using chat commands, or using the API in macros or other modules. Nevertheless if you ever suspect you are being charged for unprovoked requests from this module please disable the module immediately and raise a critical issue.
Requires the module's 'Enable API Functions' setting to be enabled.
WARNING! Using any of these functions will send a request to GPT-3 for which you will be charged like any other request made by this module. As such please be careful implenting them in macros and other modules. Test your code well before implementing these functions and I strongly advice users to avoid looping and recursive functions.
Functions to construct and send your own prompts are provided under game.modules.get('ai-description-generator').api
:
constructPrompt(language, system, world, entityType, subject, key)
: Construct and sends a prompt based on the provided context similar to how the base module does it.language
: The language GPT-3 will be encouraged to respond in. Usegame.settings.get('ai-description-generator', 'language')
to use the language provided in the module's/core's settings.system
: The RPG system to be used for context. Usegame.settings.get('ai-description-generator', 'system')
to use the system that was provided in the module's settings.world
: The world/setting to be used for context. Usegame.settings.get('ai-description-generator', 'world')
to use the world that was provided in the module's settings.entityType
: Eithercreature
,item
, orspell
.subject
: The name of the subject.key
: Your API key. Usegame.settings.get('ai-description-generator', 'key')
to use the key that was provided in the module's settings.
sendPrompt(prompt, key)
: Sends a completely custom prompt.prompt
: The prompt you want to send.key
: Your API key. Usegame.settings.get('ai-description-generator', 'key')
to use the key that was provided in the module's settings.