allow custom source url (#2255)
* Update script.js to allow custom source url * type hint fix * fixes
This commit is contained in:
parent
3832afaeba
commit
3389b5dd16
|
@ -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 '';
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
|
|
Loading…
Reference in New Issue