Eliott C commited on
✨ Link to hf.co/chat from logo (#94)
Browse filesFiles changed (3)
3 unmodified lines45677891011123 unmodified linesMONGODB_URL=#your mongodb URL hereMONGODB_DB_NAME=chat-uiHF_TOKEN=#your huggingface token hereSHARE_BASE_URL=#https://hf.co/chatCOOKIE_NAME=hf-chat
PUBLIC_ORIGIN=#https://hf.coPUBLIC_MODEL_ENDPOINT=https://api-inference.huggingface.co/models/OpenAssistant/oasst-sft-6-llama-30bPUBLIC_MODEL_NAME=OpenAssistant/oasst-sft-6-llama-30b # public facing linkPUBLIC_MODEL_ID=OpenAssistant/oasst-sft-6-llama-30b-xor # used to link to model page6 unmodified lines789101112137 unmodified lines2122232324252626272829306 unmodified lines import CarbonTrashCan from "~icons/carbon/trash-can"; import CarbonExport from "~icons/carbon/export"; import { switchTheme } from "$lib/switchTheme"; import { PUBLIC_ORIGIN } from "$env/static/public";
const dispatch = createEventDispatcher<{ shareConversation: { id: string; title: string };7 unmodified lines</script>
<div class="flex-none max-sm:pt-0 sticky top-0 px-3 py-3.5 flex items-center justify-between"> <div class="rounded-xl font-semibold text-lg flex items-center"> <a class="rounded-xl font-semibold text-lg flex items-center" href="{PUBLIC_ORIGIN}{base}/"> <Logo classNames="mr-1 text-3xl" /> HuggingChat </div> </a> <a href={base || "/"} class="flex border py-0.5 px-2 rounded-lg shadow-sm hover:shadow-none bg-white dark:bg-gray-700 dark:border-gray-600 text-center"12234518 unmodified lines242526272728293012 unmodified lines4344454646474849import { base } from "$app/paths";import { SHARE_BASE_URL } from "$env/static/private";import { PUBLIC_ORIGIN } from "$env/static/private";import { collections } from "$lib/server/database.js";import type { SharedConversation } from "$lib/types/SharedConversation.js";import { sha256 } from "$lib/utils/sha256.js";18 unmodified lines if (existingShare) { return new Response( JSON.stringify({ url: (SHARE_BASE_URL || `${url.origin}${base}`) + `/r/${existingShare._id}`, url: (PUBLIC_ORIGIN || `${url.origin}${base}`) + `/r/${existingShare._id}`, }), { headers: { "Content-Type": "application/json" } } );12 unmodified lines
return new Response( JSON.stringify({ url: (SHARE_BASE_URL || `${url.origin}${base}`) + `/r/${shared._id}`, url: `${PUBLIC_ORIGIN || url.origin}${base}/r/${shared._id}`, }), { headers: { "Content-Type": "application/json" } } );.env+1-1
src/lib/components/NavMenu.svelte+3-2
src/routes/conversation/[id]/share/+server.ts+3-3