adjusts user self-service link presentation

This commit is contained in:
nai-degen 2023-09-02 15:09:11 -05:00
parent f05e196994
commit 0e325e89e0
2 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@
# MODEL_RATE_LIMIT=4
# MAX_OUTPUT_TOKENS_OPENAI=300
# MAX_OUTPUT_TOKENS_ANTHROPIC=900
# SHOW_TOKEN_COSTS=true
# LOG_LEVEL=info
# REJECT_DISALLOWED=false
# REJECT_MESSAGE="This content violates /aicg/'s acceptable use policy."

View File

@ -114,6 +114,7 @@ function cacheInfoPageHtml(baseUrl: string) {
<hr />
<h2>Service Info</h2>
<pre>${JSON.stringify(info, null, 2)}</pre>
${getSelfServiceLinks()}
</body>
</html>`;
@ -348,13 +349,14 @@ Logs are anonymous and do not contain IP addresses or timestamps. [You can see t
if (customGreeting) {
infoBody += `\n## Server Greeting\n${customGreeting}`;
}
if (config.gatekeeper === "user_token") {
infoBody += `\n\n---\n\n[User lookup](/user/lookup)`;
}
return converter.makeHtml(infoBody);
}
function getSelfServiceLinks() {
if (config.gatekeeper !== "user_token") return "";
return `<footer style="font-size: 0.8em;"><hr /><a href="/user/lookup">Check your user token info</a></footer>`;
}
/** Returns queue time in seconds, or minutes + seconds if over 60 seconds. */
function getQueueInformation(partition: ModelFamily) {
const waitMs = getEstimatedWaitTime(partition);