diff --git a/public/script.js b/public/script.js index 4fc07fc6f..92d41cd79 100644 --- a/public/script.js +++ b/public/script.js @@ -1533,6 +1533,18 @@ function getCharacterSource(chId = this_chid) { return `https://pygmalion.chat/${pygmalionId}`; } + const githubRepo = characters[chId]?.data?.extensions?.github_repo; + + if (githubRepo) { + return `https://github.com/${githubRepo}`; + } + + const sourceUrl = characters[chId]?.data?.extensions?.source_url; + + if (sourceUrl) { + return sourceUrl; + } + return ''; } diff --git a/public/scripts/char-data.js b/public/scripts/char-data.js index 20e484f31..20db48c0a 100644 --- a/public/scripts/char-data.js +++ b/public/scripts/char-data.js @@ -70,6 +70,8 @@ * @property {"system" | "user" | "assistant"} depth_prompt.role - The role the character takes on during the prompted interaction (system, user, or assistant). * // Non-standard extensions added by external tools * @property {string} [pygmalion_id] - The unique identifier assigned to the character by the Pygmalion.chat. + * @property {string} [github_repo] - The gitHub repository associated with the character. + * @property {string} [source_url] - The source URL associated with the character. * @property {{full_path: string}} [chub] - The Chub-specific data associated with the character. */