allow custom source url (#2255)

* Update script.js to allow custom source url

* type hint fix

* fixes
This commit is contained in:
steve green
2024-05-17 03:16:57 +08:00
committed by GitHub
parent 3832afaeba
commit 3389b5dd16
2 changed files with 14 additions and 0 deletions

View File

@@ -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 '';
}