Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom URL for the used GPT API #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update settings.js
  • Loading branch information
DanielBoettner authored Mar 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f09c5711024689687271e7ae129deecb601a3a8e
17 changes: 17 additions & 0 deletions scripts/settings.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,24 @@ export const gameSystems = (() => {

export const registerSettings = () => {
// 'world' scope settings are available only to GMs
game.settings.register(moduleName, 'useCustomGPT', {
name: 'User a custom/self-hosted GPT model',
hint: 'Has to be compatible with OpenAI API. If enabled, the API key and model version settings will be ignored.',
scope: 'world',
config: true,
type: Boolean,
default: false,
});

game.settings.register(moduleName, 'customGPTUrl', {
name: 'Custom GPT model URL',
hint: 'URL of the custom GPT model. Has to be compatible with OpenAI API.',
scope: 'world',
config: true,
type: String,
default: 'http://localhost:1234',
});

game.settings.register(moduleName, 'apiKey', {
name: 'OpenAI API key',
hint: 'API key for ChatGPT from OpenAI. Get yours at https://platform.openai.com/account/api-keys .',