From 0e325e89e0aba3d112ff89c4121e9c016a0e5d8a Mon Sep 17 00:00:00 2001 From: nai-degen Date: Sat, 2 Sep 2023 15:09:11 -0500 Subject: [PATCH] adjusts user self-service link presentation --- .env.example | 1 + src/info-page.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index d5e41d2..d6babe7 100644 --- a/.env.example +++ b/.env.example @@ -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." diff --git a/src/info-page.ts b/src/info-page.ts index ed50cbb..ae3ea0d 100644 --- a/src/info-page.ts +++ b/src/info-page.ts @@ -114,6 +114,7 @@ function cacheInfoPageHtml(baseUrl: string) {

Service Info

${JSON.stringify(info, null, 2)}
+ ${getSelfServiceLinks()} `; @@ -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 ``; +} + /** Returns queue time in seconds, or minutes + seconds if over 60 seconds. */ function getQueueInformation(partition: ModelFamily) { const waitMs = getEstimatedWaitTime(partition);