This commit is contained in:
Alex 2023-10-29 03:58:59 +01:00 committed by GitHub
commit 1d61fd083e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 709 additions and 6107 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 KiB

After

Width:  |  Height:  |  Size: 907 KiB

1157
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
{
"name": "chatpad",
"name": "einfachalex",
"private": true,
"source": "src/index.html",
"browserslist": "> 0.5%, last 2 versions, not dead",
@ -18,13 +18,16 @@
"@types/react-dom": "^18.0.11",
"buffer": "^5.7.1",
"parcel": "^2.8.3",
"path-browserify": "^1.0.1",
"parcel-reporter-static-files-copy": "^1.5.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10"
},
"dependencies": {
"@emotion/react": "^11.10.6",
"@emotion/server": "^11.10.0",
"@huggingface/agents": "^0.0.5",
"@huggingface/hub": "^0.11.3",
"@huggingface/inference": "^2.6.4",
"@mantine/core": "^6.0.1",
"@mantine/hooks": "^6.0.1",
"@mantine/next": "^6.0.1",
@ -37,13 +40,14 @@
"dexie": "^3.2.3",
"dexie-export-import": "^4.0.6",
"dexie-react-hooks": "^1.1.3",
"dotenv": "^16.3.1",
"downloadjs": "^1.4.7",
"eslint": "8.36.0",
"eslint-config-next": "13.2.4",
"gpt-token-utils": "^1.2.0",
"lodash": "^4.17.21",
"nanoid": "^4.0.1",
"next": "13.2.4",
"next": "^13.5.6",
"openai": "^3.2.1",
"openai-ext": "^1.2.6",
"react": "^18.2.0",
@ -51,6 +55,22 @@
"react-icons": "^4.8.0",
"react-markdown": "^8.0.6",
"remark-gfm": "^3.0.1",
"typescript": "4.9.5"
}
"typescript": "4.9.5",
"yarn": "^1.22.19"
},
"description": "![EinfachChat AI](./banner.png)",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "git+https://github.com/Einfachalf/chatpad.git"
},
"keywords": [
"einfachchat"
],
"author": "alex",
"license": "ISC",
"bugs": {
"url": "https://github.com/Einfachalf/chatpad/issues"
},
"homepage": "https://github.com/Einfachalf/chatpad#readme"
}

0
src/.env Normal file
View file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 71 KiB

View file

@ -13,6 +13,11 @@ import {
import { ChatRoute } from "../routes/ChatRoute";
import { IndexRoute } from "../routes/IndexRoute";
import { Layout } from "./Layout";
import { createRepo, uploadFile } from "@huggingface/hub";
const HF_ACCESS_TOKEN = "hf_..."; // Ihr Hugging Face Zugriffstoken
const history = createHashHistory();
const location = new ReactLocation({ history });
@ -49,7 +54,7 @@ export function App() {
withCSSVariables
theme={{
colorScheme,
primaryColor: "teal",
primaryColor: "cyan",
globalStyles: (theme) => ({
body: {
backgroundColor:

View file

@ -27,7 +27,7 @@ export function CreatePromptModal({ content }: { content?: string }) {
return (
<>
{content ? (
<Tooltip label="Save Prompt" position="left">
<Tooltip label="Prompt speichern" position="left">
<ActionIcon onClick={open}>
<IconPlaylistAdd opacity={0.5} size={20} />
</ActionIcon>
@ -37,7 +37,7 @@ export function CreatePromptModal({ content }: { content?: string }) {
New Prompt
</Button>
)}
<Modal opened={opened} onClose={close} title="Create Prompt" size="lg">
<Modal opened={opened} onClose={close} title="Prompt erstellen" size="lg">
<form
onSubmit={async (event) => {
try {

View file

@ -19,7 +19,7 @@ export function DeleteAllDataModal({ onOpen }: { onOpen: () => void }) {
<Modal
opened={opened}
onClose={close}
title="Delete All Data"
title="Daten löschen"
size="md"
withinPortal
>

View file

@ -137,14 +137,14 @@ export function Layout() {
const id = nanoid();
db.chats.add({
id,
description: "New Chat",
description: "Neuer Chat",
totalTokens: 0,
createdAt: new Date(),
});
navigate({ to: `/chats/${id}` });
}}
>
New Chat
Neuer Chat
</Button>
)}
{tab === "Prompts" && <CreatePromptModal />}
@ -225,7 +225,7 @@ export function Layout() {
<Tooltip label="Source Code">
<ActionIcon
component="a"
href="https://github.com/deiucanta/chatpad"
href="https://github.com/einfachalf/chatpad"
target="_blank"
sx={{ flex: 1 }}
size="xl"
@ -237,7 +237,7 @@ export function Layout() {
<Tooltip label="Follow on Twitter">
<ActionIcon
component="a"
href="https://twitter.com/deiucanta"
href="https://twitter.com/einfachalf"
target="_blank"
sx={{ flex: 1 }}
size="xl"
@ -247,15 +247,15 @@ export function Layout() {
</Tooltip>
)}
{config.showFeedbackLink && (
<Tooltip label="Give Feedback">
<Tooltip label="Gebe Feedback">
<ActionIcon
component="a"
href="https://feedback.chatpad.ai"
href="https://einfachalex.net"
onClick={(event) => {
if (window.todesktop) {
event.preventDefault();
window.todesktop.contents.openUrlInBrowser(
"https://feedback.chatpad.ai"
"https://einfachalex.net"
);
}
}}

View file

@ -3,12 +3,13 @@ export function LogoText(props: JSX.IntrinsicElements["svg"]) {
<svg
fill="none"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 485 93"
viewBox="0 0 100 100"
{...props}
>
<path
d="M.93 36.03c0-6.27 1.4-11.87 4.2-16.8a30.2 30.2 0 0 1 11.6-11.6 32.88 32.88 0 0 1 16.53-4.2c7.12 0 13.36 1.82 18.72 5.48a28.6 28.6 0 0 1 11.23 15.16h-14.7a15.16 15.16 0 0 0-6.21-6.85 17.84 17.84 0 0 0-9.13-2.28c-3.72 0-7.04.88-9.96 2.64a17.85 17.85 0 0 0-6.76 7.31c-1.58 3.17-2.37 6.88-2.37 11.14 0 4.2.79 7.92 2.37 11.15a18.5 18.5 0 0 0 6.76 7.4 19.39 19.39 0 0 0 9.96 2.55c3.47 0 6.51-.76 9.13-2.28a15.71 15.71 0 0 0 6.21-6.94h14.7c-2.13 6.51-5.87 11.6-11.23 15.25-5.3 3.6-11.54 5.39-18.72 5.39-6.1 0-11.6-1.37-16.53-4.11a31.18 31.18 0 0 1-11.6-11.6C2.33 47.9.93 42.3.93 36.04Zm98.05-19.36c3.83 0 7.24.85 10.23 2.56a16.7 16.7 0 0 1 6.94 7.4c1.7 3.22 2.56 7.12 2.56 11.69V68h-12.79V40.05c0-4.02-1-7.1-3.01-9.22-2.01-2.2-4.75-3.3-8.22-3.3-3.54 0-6.34 1.1-8.4 3.3-2.02 2.13-3.02 5.2-3.02 9.22V68H70.48V.41h12.79v23.3a16.3 16.3 0 0 1 6.58-5.12 21.33 21.33 0 0 1 9.13-1.92Zm24.94 25.85c0-5.12 1.01-9.65 3.02-13.61 2.07-3.96 4.84-7 8.31-9.13a22.37 22.37 0 0 1 11.78-3.2c3.78 0 7.06.76 9.87 2.28a19.99 19.99 0 0 1 6.85 5.76V17.4h12.87V68h-12.87v-7.4a19.32 19.32 0 0 1-6.85 5.94 20.89 20.89 0 0 1-9.96 2.28c-4.26 0-8.16-1.1-11.69-3.29a23.53 23.53 0 0 1-8.31-9.22 30.45 30.45 0 0 1-3.02-13.8Zm39.83.18c0-3.1-.61-5.75-1.83-7.95a12.5 12.5 0 0 0-4.93-5.11 12.93 12.93 0 0 0-6.67-1.83c-2.37 0-4.57.58-6.58 1.74a13.4 13.4 0 0 0-4.93 5.11 15.93 15.93 0 0 0-1.82 7.86 17 17 0 0 0 1.82 8.04 14.03 14.03 0 0 0 4.93 5.2 12.77 12.77 0 0 0 6.58 1.83c2.38 0 4.6-.58 6.67-1.74a13.29 13.29 0 0 0 4.93-5.11 16.68 16.68 0 0 0 1.83-8.04Zm36.6-14.8v24.48c0 1.7.4 2.96 1.18 3.75.86.73 2.26 1.1 4.2 1.1h5.94V68h-8.03c-10.78 0-16.17-5.24-16.17-15.7V27.9h-6.03V17.4h6.03V4.9h12.88v12.5h11.32v10.5h-11.32ZM230 24.7a19.1 19.1 0 0 1 6.76-5.75 20.56 20.56 0 0 1 9.96-2.37 21.9 21.9 0 0 1 20 12.33c2.07 3.9 3.1 8.43 3.1 13.6 0 5.18-1.03 9.78-3.1 13.8a22.62 22.62 0 0 1-8.31 9.22 21.44 21.44 0 0 1-11.7 3.3c-3.7 0-7-.77-9.86-2.3a21.2 21.2 0 0 1-6.85-5.75v31.33h-12.78v-74.7H230v7.3Zm26.76 17.82c0-3.05-.64-5.66-1.91-7.86a12.95 12.95 0 0 0-18.08-5.02 13.3 13.3 0 0 0-4.94 5.11A16.46 16.46 0 0 0 230 42.7c0 3.05.61 5.7 1.83 7.95a14.01 14.01 0 0 0 4.93 5.2 13.28 13.28 0 0 0 6.58 1.74 13.13 13.13 0 0 0 11.5-7.03 16.03 16.03 0 0 0 1.92-8.04Zm15.41 0c0-5.12 1-9.65 3.02-13.61 2.07-3.96 4.84-7 8.3-9.13a22.37 22.37 0 0 1 11.8-3.2c3.77 0 7.05.76 9.85 2.28a19.99 19.99 0 0 1 6.86 5.76V17.4h12.87V68H312v-7.4a19.32 19.32 0 0 1-6.85 5.94 20.89 20.89 0 0 1-9.95 2.28c-4.26 0-8.16-1.1-11.7-3.29a23.53 23.53 0 0 1-8.3-9.22 30.45 30.45 0 0 1-3.02-13.8Zm39.82.18c0-3.1-.6-5.75-1.82-7.95a12.5 12.5 0 0 0-4.93-5.11 12.93 12.93 0 0 0-6.67-1.83c-2.38 0-4.57.58-6.58 1.74a13.4 13.4 0 0 0-4.93 5.11 15.93 15.93 0 0 0-1.82 7.86 17 17 0 0 0 1.82 8.04 14.03 14.03 0 0 0 4.93 5.2 12.77 12.77 0 0 0 6.58 1.83c2.37 0 4.6-.58 6.67-1.74a13.29 13.29 0 0 0 4.93-5.11 16.68 16.68 0 0 0 1.82-8.04Zm18.43-.18c0-5.12 1-9.65 3.01-13.61 2.07-3.96 4.88-7 8.4-9.13a22.37 22.37 0 0 1 11.79-3.2c3.29 0 6.42.73 9.4 2.2a18.42 18.42 0 0 1 7.13 5.65V.41h12.97V68h-12.97v-7.49a17.3 17.3 0 0 1-6.67 6.03 20.89 20.89 0 0 1-9.95 2.28c-4.26 0-8.16-1.1-11.7-3.29a23.29 23.29 0 0 1-8.4-9.22c-2-4.02-3.01-8.62-3.01-13.8Zm39.82.18c0-3.1-.6-5.75-1.82-7.95a12.5 12.5 0 0 0-4.94-5.11 12.93 12.93 0 0 0-6.66-1.83c-2.38 0-4.57.58-6.58 1.74a13.3 13.3 0 0 0-4.93 5.11 15.93 15.93 0 0 0-1.83 7.86 17 17 0 0 0 1.83 8.04 14.01 14.01 0 0 0 4.93 5.2 12.77 12.77 0 0 0 6.58 1.83c2.37 0 4.6-.58 6.66-1.74a13.29 13.29 0 0 0 4.94-5.11 16.67 16.67 0 0 0 1.82-8.04Zm78.91 13.15h-25.39L419.56 68h-13.42l22.92-63.84h14.89L466.87 68h-13.51l-4.2-12.15Zm-3.47-10.23-9.22-26.67-9.22 26.67h18.44Zm38.9-41.37V68h-12.8V4.25h12.8Z"
fill="currentColor"
<image
href="https://einfachalex.net/storage/2023/09/d40d35b3063c11244fbf38e9b55074be.png"
width="300"
height="100"
/>
</svg>
);
@ -19,32 +20,18 @@ export function Logo(props: JSX.IntrinsicElements["svg"]) {
<svg
fill="none"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 630 117"
viewBox="0 0 100 100"
{...props}
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M117 26.7A26.7 26.7 0 0 0 90.3 0H27.09A26.7 26.7 0 0 0 .38 26.7v63.23a26.7 26.7 0 0 0 26.7 26.7h66.74a23.18 23.18 0 0 0 23.19-23.19V26.7ZM35.5 70.26V11.24h-8.42A15.46 15.46 0 0 0 11.62 26.7v43.56h23.89ZM11.63 81.5h59.02v23.89H27.08a15.46 15.46 0 0 1-15.46-15.46V81.5Zm94.14-46.37H46.74V11.24h43.57c8.53 0 15.45 6.92 15.45 15.46v8.43Zm-23.88 70.25V46.37h23.88v47.07c0 6.6-5.34 11.95-11.94 11.95H81.88Z"
fill="url(#a)"
/>
<path
d="M146 58.62c0-6.27 1.4-11.87 4.2-16.8 2.86-5 6.73-8.86 11.6-11.6a32.88 32.88 0 0 1 16.53-4.2c7.13 0 13.37 1.82 18.72 5.47a28.72 28.72 0 0 1 11.24 15.17h-14.7a15.16 15.16 0 0 0-6.22-6.85 17.84 17.84 0 0 0-9.13-2.29c-3.71 0-7.03.88-9.96 2.65a17.86 17.86 0 0 0-6.75 7.3c-1.59 3.17-2.38 6.89-2.38 11.15a25 25 0 0 0 2.38 11.14 18.5 18.5 0 0 0 6.75 7.4 19.39 19.39 0 0 0 9.96 2.56c3.47 0 6.52-.76 9.13-2.29a15.72 15.72 0 0 0 6.22-6.94h14.7c-2.13 6.52-5.88 11.6-11.23 15.26-5.3 3.59-11.54 5.38-18.73 5.38-6.09 0-11.6-1.37-16.53-4.1a31.19 31.19 0 0 1-11.6-11.6c-2.8-4.94-4.2-10.54-4.2-16.81Zm98.05-19.36c3.84 0 7.25.85 10.23 2.55a16.71 16.71 0 0 1 6.94 7.4c1.7 3.23 2.56 7.13 2.56 11.7v29.68H251V62.64c0-4.02-1.01-7.1-3.02-9.23-2-2.19-4.75-3.28-8.22-3.28-3.53 0-6.33 1.1-8.4 3.28-2.01 2.14-3.02 5.21-3.02 9.23v27.95h-12.78V23h12.78v23.29a16.3 16.3 0 0 1 6.58-5.11 21.34 21.34 0 0 1 9.13-1.92ZM269 65.1c0-5.11 1-9.65 3.01-13.6 2.07-3.96 4.84-7 8.31-9.14a22.36 22.36 0 0 1 11.79-3.2c3.77 0 7.06.77 9.86 2.29a20 20 0 0 1 6.85 5.75V40h12.88v50.6h-12.88v-7.4a19.32 19.32 0 0 1-6.85 5.94 20.88 20.88 0 0 1-9.95 2.28c-4.27 0-8.16-1.1-11.7-3.29a23.52 23.52 0 0 1-8.3-9.22C270 74.88 269 70.28 269 65.1Zm39.82.19c0-3.1-.6-5.76-1.83-7.95a12.5 12.5 0 0 0-4.93-5.11 12.93 12.93 0 0 0-6.67-1.83 12.92 12.92 0 0 0-11.5 6.85 15.93 15.93 0 0 0-1.83 7.85 17 17 0 0 0 1.83 8.04 14.03 14.03 0 0 0 4.93 5.2 12.77 12.77 0 0 0 6.57 1.83c2.38 0 4.6-.57 6.67-1.73a13.29 13.29 0 0 0 4.93-5.12 16.67 16.67 0 0 0 1.83-8.03Zm36.6-14.79v24.47c0 1.7.4 2.95 1.19 3.74.85.73 2.25 1.1 4.2 1.1h5.94v10.78h-8.04c-10.78 0-16.17-5.24-16.17-15.71V50.49h-6.03V40h6.03V27.48h12.88v12.5h11.33V50.5h-11.33Zm29.66-3.2a19.1 19.1 0 0 1 6.76-5.76 20.56 20.56 0 0 1 9.95-2.37 21.9 21.9 0 0 1 20 12.33c2.07 3.9 3.1 8.43 3.1 13.6 0 5.18-1.03 9.78-3.1 13.8-2 3.95-4.78 7.03-8.3 9.22a21.44 21.44 0 0 1-11.7 3.29c-3.71 0-7-.76-9.86-2.28a21.2 21.2 0 0 1-6.85-5.76v31.33h-12.79V39.99h12.79v7.3Zm26.76 17.8c0-3.04-.64-5.66-1.92-7.85a12.95 12.95 0 0 0-18.08-5.02 13.3 13.3 0 0 0-4.94 5.11 16.46 16.46 0 0 0-1.82 7.95c0 3.04.6 5.69 1.82 7.94a14.01 14.01 0 0 0 4.94 5.2 13.28 13.28 0 0 0 6.57 1.74 13.13 13.13 0 0 0 11.5-7.03 16.03 16.03 0 0 0 1.93-8.04Zm15.41 0c0-5.11 1-9.65 3.01-13.6 2.07-3.96 4.84-7 8.31-9.14a22.36 22.36 0 0 1 11.79-3.2c3.77 0 7.06.77 9.86 2.29a20 20 0 0 1 6.85 5.75V40h12.88v50.6h-12.88v-7.4a19.32 19.32 0 0 1-6.85 5.94 20.88 20.88 0 0 1-9.96 2.28c-4.26 0-8.15-1.1-11.69-3.29a23.52 23.52 0 0 1-8.3-9.22c-2.02-4.02-3.02-8.62-3.02-13.8Zm39.82.19c0-3.1-.6-5.76-1.83-7.95a12.5 12.5 0 0 0-4.93-5.11 12.93 12.93 0 0 0-6.67-1.83 12.92 12.92 0 0 0-11.5 6.85 15.93 15.93 0 0 0-1.83 7.85 17 17 0 0 0 1.83 8.04 14.03 14.03 0 0 0 4.93 5.2 12.77 12.77 0 0 0 6.57 1.83c2.38 0 4.6-.57 6.67-1.73a13.29 13.29 0 0 0 4.93-5.12 16.67 16.67 0 0 0 1.83-8.03Zm18.43-.19c0-5.11 1-9.65 3-13.6 2.08-3.96 4.88-7 8.41-9.14a22.36 22.36 0 0 1 11.78-3.2c3.3 0 6.43.74 9.41 2.2a18.43 18.43 0 0 1 7.13 5.66V23h12.96v67.59h-12.97v-7.5a17.36 17.36 0 0 1-6.66 6.04 20.89 20.89 0 0 1-9.96 2.28c-4.26 0-8.16-1.1-11.69-3.29a23.28 23.28 0 0 1-8.4-9.22c-2.01-4.02-3.01-8.62-3.01-13.8Zm39.82.19c0-3.1-.61-5.76-1.83-7.95a12.5 12.5 0 0 0-4.93-5.11 12.93 12.93 0 0 0-6.67-1.83c-2.37 0-4.57.58-6.58 1.74-2 1.15-3.65 2.86-4.93 5.11a15.94 15.94 0 0 0-1.82 7.85c0 3.05.6 5.73 1.82 8.04a14.03 14.03 0 0 0 4.93 5.2 12.77 12.77 0 0 0 6.58 1.83c2.38 0 4.6-.57 6.67-1.73a13.29 13.29 0 0 0 4.93-5.12 16.68 16.68 0 0 0 1.83-8.03Zm78.91 13.15h-25.4l-4.2 12.15h-13.42l22.93-63.85h14.88l22.93 63.85h-13.52l-4.2-12.15Zm-3.47-10.23-9.23-26.67-9.22 26.67h18.45Zm38.89-41.37v63.75h-12.79V26.84h12.8Z"
fill="currentColor"
/>
<defs>
<linearGradient
id="a"
x1={59}
y1={-12.54}
x2={59}
y2={116.46}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#41E094" />
<stop offset={1} stopColor="#27B882" />
</linearGradient>
<pattern id="image" x="0" y="0" patternUnits="userSpaceOnUse" width="300" height="100">
<image href="https://einfachalex.net/storage/2023/09/d40d35b3063c11244fbf38e9b55074be.png" width="100" height="100" />
</pattern>
</defs>
<path
fill={`url(#image)`}
d="M0 0h100v100H0z"
/>
</svg>
);
}

View file

@ -106,7 +106,7 @@ export function Prompts({
{
role: "system",
content:
"You are ChatGPT, a large language model trained by OpenAI.",
"Du sprichst mit EinfachGPT, einem umfangreichen Sprachmodell, das von EinfachAlex entwickelt wurde. Ich stehe dir zur Verfügung, um deine Fragen zu beantworten und dir bei deinen Anliegen zu helfen. Wie kann ich dir heute weiterhelfen?",
},
{ role: "user", content: prompt.content },
]);

View file

@ -97,7 +97,7 @@ export function SettingsModal({ children }: { children: ReactElement }) {
>
<Flex gap="xs" align="end">
<PasswordInput
label="OpenAI API Key"
label="OpenAI API Key, Replicate Huggingface"
placeholder="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
sx={{ flex: 1 }}
value={value}
@ -116,19 +116,19 @@ export function SettingsModal({ children }: { children: ReactElement }) {
href="https://platform.openai.com/account/api-keys"
target="_blank"
>
Get your OpenAI API key
Erhalte Deinen Api Schlüssel
</Anchor>
</Text>
</List.Item>
<List.Item>
<Text size="sm" color="dimmed">
The API Key is stored locally on your browser and never sent
anywhere else.
Der API-Schlüssel wird einfach lokal in Ihrem Browser gespeichert
und niemals woanders hin gesendet.
</Text>
</List.Item>
</List>
<Select
label="OpenAI Type"
label="OpenAI Modell Type"
value={type}
onChange={async (value) => {
setSubmitting(true);
@ -161,7 +161,7 @@ export function SettingsModal({ children }: { children: ReactElement }) {
}
}}
withinPortal
data={[{ "value": "openai", "label": "OpenAI"}, { "value": "custom", "label": "Custom (e.g. Azure OpenAI)"}]}
data={[{ "value": "openai", "label": "OpenAI"}, { "value": "custom", "label": "Custom (e.g. Huggingface)"}]}
/>
<Select
label="OpenAI Model (OpenAI Only)"

View file

@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Chatpad AI</title>
<title>EinfachChat AI</title>
<meta
name="description"
content="A free, open-source, and slick UI for ChatGPT"

View file

@ -29,12 +29,12 @@ export function IndexRoute() {
<>
<Center py="xl" sx={{ height: "100%" }}>
<Container size="sm">
<Badge mb="lg">GPT-4 Ready</Badge>
<Badge mb="lg">GPT-4, Llama2, Mistral uvm. Ready</Badge>
<Text>
<Logo style={{ maxWidth: 240 }} />
<Logo style={{ maxWidth: 10 }} />
</Text>
<Text mt={4} size="xl">
Not just another ChatGPT user-interface!
Weil GPT so einfach sein kann! www.einfachalex.net
</Text>
<SimpleGrid
mt={50}
@ -70,15 +70,12 @@ export function IndexRoute() {
)}
{config.showDownloadLink && !window.todesktop && (
<Button
component="a"
href="https://dl.todesktop.com/230313oyppkw40a"
// href="https://download.chatpad.ai/"
size="md"
variant="outline"
leftIcon={<IconCloudDownload size={20} />}
>
Download Desktop App
</Button>
size="md"
variant={openAiApiKey ? "light" : "filled"}
leftIcon={<IconKey size={20} />}
>
{openAiApiKey ? "Change HF Key" : "Enter HF Key"}
</Button>
)}
</Group>
</Container>
@ -90,20 +87,20 @@ export function IndexRoute() {
const features = [
{
icon: IconCurrencyDollar,
title: "Free and open source",
title: "Kostenlos und Open Source",
description:
"This app is provided for free and the source code is available on GitHub.",
},
{
"Diese App ist kostenlos erhältlich, und der Quellcode ist auf GitHub verfügbar.",
},
{
icon: IconLock,
title: "Privacy focused",
title: "Datenschutz im Fokus",
description:
"No tracking, no cookies, no bullshit. All your data is stored locally.",
},
{
"Kein Tracking, keine Cookies, kein Unsinn. Alle deine Daten werden lokal gespeichert.",
},
{
icon: IconNorthStar,
title: "Best experience",
title: "Bestmögliche Erfahrung",
description:
"Crafted with love and care to provide the best experience possible.",
},
"Mit Liebe und Sorgfalt entwickelt, um die bestmögliche Erfahrung zu bieten.",
},
];

View file

@ -53,171 +53,288 @@
],
"writingCharacters": [
{
"label": "Standup Comedian",
"value": "A performer who entertains audiences by telling jokes and humorous stories."
"label": "Stand-up-Comedian",
"value": "Ein Künstler, der das Publikum durch Witze und humorvolle Geschichten unterhält."
},
{
"label": "Life Coach",
"value": "A professional who helps individuals identify and achieve their personal and professional goals."
"label": "Lebensberater",
"value": "Ein Fachmann, der Einzelpersonen hilft, ihre persönlichen und beruflichen Ziele zu identifizieren und zu erreichen."
},
{
"label": "Career Counselor",
"value": "A professional who helps individuals explore and choose careers, develop job search strategies, and improve job performance."
"label": "Berufsberater",
"value": "Ein Fachmann, der Einzelpersonen hilft, Berufe zu erkunden und auszuwählen, Job-Suchstrategien zu entwickeln und die Arbeitsleistung zu verbessern."
},
{
"label": "Nutritionist",
"value": "A health professional who specializes in the study of nutrition and its effects on the body."
"label": "Ernährungsberater",
"value": "Ein Gesundheitsfachmann, der sich auf das Studium der Ernährung und ihre Auswirkungen auf den Körper spezialisiert hat."
},
{
"label": "Product Manager",
"value": "A professional who oversees the development and marketing of a company's products."
"label": "Produktmanager",
"value": "Ein Fachmann, der die Entwicklung und Vermarktung der Produkte eines Unternehmens überwacht."
},
{
"label": "Personal Trainer",
"value": "A fitness professional who works with individuals to develop personalized exercise programs and improve their overall health and fitness."
"value": "Ein Fitnessfachmann, der mit Einzelpersonen zusammenarbeitet, um individuelle Trainingsprogramme zu entwickeln und ihre allgemeine Gesundheit und Fitness zu verbessern."
},
{
"label": "Life Hacker",
"value": "A person who uses unconventional methods to solve problems and increase productivity in everyday life."
"value": "Eine Person, die unkonventionelle Methoden verwendet, um Probleme zu lösen und die Produktivität im Alltag zu steigern."
},
{
"label": "Travel Advisor",
"value": "A professional who helps individuals plan and book travel arrangements."
"label": "Reiseberater",
"value": "Ein Fachmann, der Einzelpersonen hilft, Reisearrangements zu planen und zu buchen."
},
{
"label": "Mindfulness Coach",
"value": "A professional who helps individuals develop mindfulness practices to reduce stress and improve well-being."
"label": "Achtsamkeitstrainer",
"value": "Ein Fachmann, der Einzelpersonen hilft, Achtsamkeitspraktiken zu entwickeln, um Stress zu reduzieren und das Wohlbefinden zu verbessern."
},
{
"label": "Financial Advisor",
"value": "A professional who provides guidance and advice on financial planning, investment strategies, and retirement planning."
"label": "Finanzberater",
"value": "Ein Fachmann, der Beratung und Ratschläge zur Finanzplanung, Anlagestrategien und Altersvorsorge bietet."
},
{
"label": "Language Tutor",
"value": "A teacher who helps individuals learn and improve their language skills."
"label": "Sprachlehrer",
"value": "Ein Lehrer, der Einzelpersonen hilft, ihre Sprachkenntnisse zu erlernen und zu verbessern."
},
{
"label": "Travel Guide",
"value": "A professional who leads tours and provides information about local attractions and culture."
"label": "Reiseführer",
"value": "Ein Fachmann, der Touren leitet und Informationen über lokale Sehenswürdigkeiten und Kultur bietet."
},
{
"label": "Marketing Expert",
"value": "A professional who develops and implements marketing strategies to promote products and services."
"label": "Marketingexperte",
"value": "Ein Fachmann, der Marketingstrategien entwickelt und umsetzt, um Produkte und Dienstleistungen zu fördern."
},
{
"label": "Software Developer",
"value": "A professional who designs, develops, and maintains software applications and systems."
"label": "Softwareentwickler",
"value": "Ein Fachmann, der Softwareanwendungen und -systeme entwirft, entwickelt und wartet."
},
{
"label": "Dating Coach",
"value": "A professional who helps individuals improve their dating and relationship skills."
"value": "Ein Fachmann, der Einzelpersonen hilft, ihre Dating- und Beziehungsfähigkeiten zu verbessern."
},
{
"label": "DIY Expert",
"value": "A person who is skilled at completing a wide range of do-it-yourself projects around the home."
"label": "DIY-Experte",
"value": "Eine Person, die geschickt darin ist, eine Vielzahl von Heimwerkerprojekten rund um das Haus abzuschließen."
},
{
"label": "Journalist",
"value": "A professional who investigates and reports on current events and news stories."
"value": "Ein Fachmann, der aktuelle Ereignisse und Nachrichten recherchiert und darüber berichtet."
},
{
"label": "Tech Writer",
"value": "A professional who writes about technology and related topics for a variety of audiences."
"label": "Technikautor",
"value": "Ein Fachmann, der über Technologie und verwandte Themen für verschiedene Zielgruppen schreibt."
},
{
"label": "Professional Chef",
"value": "A skilled culinary professional who prepares meals and manages kitchen operations."
"label": "Professioneller Koch",
"value": "Ein qualifizierter kulinarischer Fachmann, der Mahlzeiten zubereitet und Küchenabläufe leitet."
},
{
"label": "Professional Salesperson",
"value": "A professional who sells products and services to businesses and consumers."
"label": "Professioneller Verkäufer",
"value": "Ein Fachmann, der Produkte und Dienstleistungen an Unternehmen und Verbraucher verkauft."
},
{
"label": "Startup Tech Lawyer",
"value": "A legal professional who specializes in providing legal advice and services to startup technology companies."
"label": "Startup Tech Anwalt",
"value": "Ein Rechtsfachmann, der sich darauf spezialisiert hat, Start-up-Technologieunternehmen rechtliche Beratung und Dienstleistungen zu bieten."
},
{
"label": "Graphic Designer",
"value": "A professional who designs visual materials such as logos, brochures, and websites."
"label": "Grafikdesigner",
"value": "Ein Fachmann, der visuelle Materialien wie Logos, Broschüren und Websites entwirft."
},
{
"label": "Academic Researcher",
"value": "A professional who conducts research and produces scholarly work in a particular academic field."
"label": "Akademischer Forscher",
"value": "Ein Fachmann, der Forschung betreibt und wissenschaftliche Arbeiten in einem bestimmten akademischen Bereich produziert."
},
{
"label": "Customer Support Agent",
"value": "A professional who provides assistance and support to customers who have questions or problems with a company's products or services."
"label": "Kundendienstmitarbeiter",
"value": "Ein Fachmann, der Unterstützung und Hilfe für Kunden bietet, die Fragen oder Probleme mit den Produkten oder Dienstleistungen eines Unternehmens haben."
},
{
"label": "HR Consultant",
"value": "A professional who provides guidance and advice to organizations on human resource management and strategy"
}
"label": "HR-Berater",
"value": "Ein Fachmann, der Organisationen Beratung und Ratschläge zur Personalverwaltung und -strategie bietet."
},
{
"label": "No-Code Entwickler",
"value": "Ein Fachmann, der Anwendungen, Websites und andere Softwareprodukte erstellt, ohne Code zu schreiben, indem er visuelle Entwicklungstools und vorgefertigte Komponenten verwendet."
},
{
"label": "Front-End Entwickler",
"value": "Ein Fachmann, der Benutzeroberflächen für Websites und Anwendungen entwirft und entwickelt, unter Verwendung von HTML, CSS und JavaScript."
},
{
"label": "Back-End Entwickler",
"value": "Ein Fachmann, der die Serverseite von Websites und Anwendungen erstellt und wartet, unter Verwendung von Technologien wie Node.js, Python und Ruby on Rails."
},
{
"label": "Full-Stack Entwickler",
"value": "Ein Fachmann, der sowohl an der Front-End als auch an der Back-End von Websites und Anwendungen arbeiten kann und alles von der Datenbankgestaltung bis zur Benutzeroberflächenentwicklung handhabt."
},
{
"label": "Webflow Entwickler",
"value": "Ein Fachmann, der Websites mit Webflow entwirft und entwickelt, einer visuellen Entwicklungsplattform, die erweiterte Anpassungen ohne die Notwendigkeit von Programmierkenntnissen ermöglicht."
},
{
"label": "Softwareentwickler",
"value": "Ein Fachmann, der Softwareanwendungen und -systeme entwirft, entwickelt und wartet."
},
{
"label": "UX Designer",
"value": "Ein Fachmann, der Benutzererfahrungen für Websites und Anwendungen entwirft, unter Verwendung von Forschung, Wireframing und Prototyping-Techniken, um intuitive Schnittstellen zu erstellen."
},
{
"label": "UI Designer",
"value": "Ein Fachmann, der die visuellen Elemente von Benutzeroberflächen für Websites und Anwendungen entwirft, unter Verwendung von Tools wie Adobe XD, Sketch und Figma."
},
{
"label": "Webdesigner",
"value": "Ein Fachmann, der die visuellen Aspekte von Websites entwirft, einschließlich Layouts, Farbschemata, Typografie und Benutzeroberflächen, unter Verwendung von Tools wie Adobe Photoshop, Sketch und Figma."
},
{
"label": "Produktdesigner",
"value": "Ein Fachmann, der das gesamte Benutzererlebnis eines Produkts entwirft, einschließlich seines Aussehens und Gefühls, der Benutzeroberfläche und des Interaktionsdesigns, unter Verwendung von Tools wie Sketch, Figma und InVision."
},
{
"label": "Produktmanager",
"value": "Ein Fachmann, der die Entwicklung und Vermarktung der Produkte eines Unternehmens überwacht."
},
{
"label": "Marketingexperte",
"value": "Ein Fachmann, der Marketingstrategien entwickelt und umsetzt, um Produkte und Dienstleistungen zu fördern."
},
{
"label": "Growth Hacker",
"value": "Ein Fachmann, der kreative und analytische Marketingtechniken verwendet, um die Benutzerbasis und den Umsatz eines Produkts oder einer Dienstleistung schnell zu steigern, unter Verwendung von Kanälen wie sozialen Medien, E-Mail und SEO."
},
{
"label": "SEO Experte",
"value": "Ein Fachmann, der Websites und Inhalte optimiert, um ihre Sichtbarkeit und Platzierung in den Suchmaschinenergebnisseiten zu verbessern, unter Verwendung von Techniken wie Keyword-Recherche, Linkaufbau und Inhaltoptimierung."
},
{
"label": "Technischer Schriftsteller",
"value": "Ein Fachmann, der über Technologie und verwandte Themen für verschiedene Zielgruppen schreibt."
},
{
"label": "Texter",
"value": "Ein Fachmann, der schriftliche Inhalte für Websites, Marketingmaterialien und andere Medien erstellt, unter Verwendung von überzeugender Sprache und Erzähltechniken, um Zielgruppen zu binden und zu konvertieren."
},
{
"label": "Datenwissenschaftler",
"value": "Ein Fachmann, der statistische und maschinelle Lernmethoden verwendet, um große Mengen von Daten zu analysieren und Erkenntnisse für Geschäftsentscheidungen abzuleiten."
},
{
"label": "Maschinelles Lernen Ingenieur",
"value": "Ein Fachmann, der Systeme entwirft, erstellt und wartet, die maschinelle Lernalgorithmen verwenden, um Automatisierung, Genauigkeit und Entscheidungsfindung zu verbessern."
},
{
"label": "Datenbankadministrator",
"value": "Ein Fachmann, der Datenbanken für Organisationen verwaltet und wartet, um Datenintegrität, Sicherheit und Verfügbarkeit zu gewährleisten."
},
{
"label": "Systemadministrator",
"value": "Ein Fachmann, der die Hardware- und Softwareinfrastruktur installiert, konfiguriert und wartet, die die IT-Systeme einer Organisation unterstützt."
},
{
"label": "Netzwerkingenieur",
"value": "Ein Fachmann, der Computernetzwerke für Organisationen entwirft, implementiert und wartet, um Konnektivität, Sicherheit und Leistung zu gewährleisten."
},
{
"label": "Cybersicherheitsanalyst",
"value": "Ein Fachmann, der Organisationen vor Cyberangriffen schützt, indem er Netzwerke überwacht, Schwachstellen identifiziert und Sicherheitsmaßnahmen implementiert."
},
{
"label": "DevOps Ingenieur",
"value": "Ein Fachmann, der Softwareentwicklung und IT-Betrieb kombiniert, um die Bereitstellung und Verwaltung von Softwareanwendungen zu rationalisieren."
},
{
"label": "Cloud Architekt",
"value": "Ein Fachmann, der Cloud-Computing-Lösungen für Organisationen entwirft und die Implementierung überwacht, unter Verwendung von Plattformen wie AWS, Azure und Google Cloud."
},
{
"label": "Startup Tech Anwalt",
"value": "Ein Rechtsfachmann, der sich darauf spezialisiert hat, Start-up-Technologieunternehmen rechtliche Beratung und Dienstleistungen anzubieten."
},
{
"label": "Mobile App Entwickler",
"value": "Ein Fachmann, der Anwendungen für mobile Geräte entwirft und entwickelt, unter Verwendung von Sprachen wie Java, Kotlin, Swift und React Native."
},
{
"label": "Spielentwickler",
"value": "Ein Fachmann, der Videospiele entwirft und entwickelt, unter Verwendung von Spiel-Engines wie Unity und Unreal Engine und Programmiersprachen wie C++ und C#."
}
],
"writingTones": [
"Assertive",
"Authoritative",
"Casual",
"Confident",
"Condescending",
"Conversational",
"Diplomatic",
"Direct",
"Eloquent",
"Formal",
"Friendly",
"Humorous",
"Informative",
"Inspiring",
"Intense",
"Irritable",
"Joking",
"Polite",
"Sarcastic",
"Sincere",
"Soothing",
"Stern",
"Sympathetic",
"Tactful",
"Witty"
"Bestimmt",
"Professionell",
"Gesprächig",
"Humorvoll",
"Technisch",
"Inspirierend",
"Bildend",
"Ermutigend",
"Überzeugend",
"Analytisch",
"Optimistisch",
"Kritisch",
"Kreativ",
"Kollaborativ",
"Autoritär",
"Fragend",
"Einfühlsam",
"Nachdenklich",
"Informativ",
"Sachlich",
"Begeistert",
"Neutral",
"Respektvoll",
"Zynisch",
"Skeptisch"
],
"writingStyles": [
"Academic",
"Analytical",
"Argumentative",
"Conversational",
"Creative",
"Critical",
"Descriptive",
"Explanatory",
"Informative",
"Instructive",
"Investigative",
"Journalistic",
"Metaphorical",
"Narrative",
"Persuasive",
"Poetic",
"Satirical",
"Technical"
"Akademisch",
"Analytisch",
"Argumentativ",
"Gesprächig",
"Kreativ",
"Kritisch",
"Beschreibend",
"Erklärend",
"Informativ",
"Anweisend",
"Untersuchend",
"Journalistisch",
"Metaphorisch",
"Erzählend",
"Überzeugend",
"Poetisch",
"Satirisch",
"Technisch",
"Formell",
"Umgangssprachlich",
"Reflektierend",
"Rhetorisch",
"Subjektiv",
"Objektiv"
],
"writingFormats": [
{
"value": "Answer as concise as possible",
"label": "Concise"
"value": "Antworte so knapp wie möglich",
"label": "Kurz und knapp"
},
{
"value": "Think step-by-step",
"label": "Step-by-step"
"value": "Denke Schritt für Schritt",
"label": "Schritt-für-Schritt"
},
{
"value": "Answer in painstakingly detail",
"label": "Extreme Detail"
"value": "Antworte in äußerst detaillierter Weise",
"label": "Extrem detailliert"
},
{
"value": "Explain like I'm five",
"label": "Explain Like I'm Five"
"value": "Erkläre es mir, als wäre ich fünf",
"label": "Erkläre wie für ein 5-jähriges Kind"
}
],
"showDownloadLink": true,
"allowDarkModeToggle": true,
"allowSettingsModal": true,

View file

@ -1,6 +1,6 @@
interface Config {
defaultModel: AvailableModel["value"];
defaultType: 'openai' | 'custom';
defaultType: 'openai' | 'custom' | 'huggingface'; // Hinzugefügt 'huggingface' als Option
defaultAuth: 'none' | 'bearer-token' | 'api-key';
defaultBase: string;
defaultVersion: string;
@ -22,12 +22,12 @@ interface AvailableModel {
value: string;
label: string;
}
interface WritingCharacter {
label: string;
value: string;
}
interface WritingFormat {
value: string;
label: string;

View file

@ -0,0 +1,23 @@
// huggingfaceInference.ts
import { HfInference } from '@huggingface/inference';
const Hf = new HfInference(process.env.HUGGINGFACE_API_KEY);
export async function generateText(input: string) {
const generator = await Hf.textGenerationStream({
model: 'oasst-sft-4-pythia-12b-epoch-3.5',
inputs: input,
parameters: {
max_new_tokens: 200,
repetition_penalty: 1,
truncate: 1000,
},
});
let generatedText = '';
for await (const chunk of generator) {
generatedText += chunk.generated_text;
}
return generatedText;
}

View file

@ -3,6 +3,7 @@ import { ChatCompletionRequestMessage, Configuration, OpenAIApi } from "openai";
import { OpenAIExt } from "openai-ext";
import { db } from "../db";
import { config } from "./config";
import { generateText } from "./huggingfaceInference"; // Importieren Sie die Huggingface-Funktion
function getClient(
apiKey: string,
@ -83,23 +84,28 @@ export async function createChatCompletion(
const base = settings?.openAiApiBase ?? config.defaultBase;
const version = settings?.openAiApiVersion ?? config.defaultVersion;
const client = getClient(apiKey, type, auth, base);
return client.createChatCompletion(
{
model,
stream: false,
messages,
},
{
headers: {
"Content-Type": "application/json",
...(type === "custom" && auth === "api-key" && { "api-key": apiKey }),
if (type === "huggingface") {
const input = messages.map(message => message.content).join(" ");
return generateText(input);
} else {
const client = getClient(apiKey, type, auth, base);
return client.createChatCompletion(
{
model,
stream: false,
messages,
},
params: {
...(type === "custom" && { "api-version": version }),
},
}
);
{
headers: {
"Content-Type": "application/json",
...(type === "custom" && auth === "api-key" && { "api-key": apiKey }),
},
params: {
...(type === "custom" && { "api-version": version }),
},
}
);
}
}
export async function checkOpenAIKey(apiKey: string) {

5124
yarn.lock

File diff suppressed because it is too large Load diff