Merge pull request #63 from sijinhui/dev

Dev
This commit is contained in:
sijinhui 2024-04-16 13:50:19 +08:00 committed by GitHub
commit f9d2d2ecbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 184 additions and 10 deletions

View File

@ -72,8 +72,8 @@ jobs:
docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns
docker-compose pull && docker-compose up -d
yes | docker image prune
rm -rf /www/server/nginx/proxy_cache_dir/*
rm -rf /www/server/nginx/proxy_temp_dir/*
rm -rf /www/server/nginx/proxy_cache_dir/* || true
rm -rf /www/server/nginx/proxy_temp_dir/* || true
- name: Sync repository to xy-nm
@ -103,7 +103,7 @@ jobs:
docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns
docker-compose pull && docker-compose up -d
yes | docker image prune
rm -rf /www/server/nginx/proxy_cache_dir/*
rm -rf /www/server/nginx/proxy_temp_dir/*
rm -rf /www/server/nginx/proxy_cache_dir/* || true
rm -rf /www/server/nginx/proxy_temp_dir/* || true

View File

@ -73,8 +73,8 @@ jobs:
docker network ls | grep -qw chatgpt-ns || docker network create chatgpt-ns
docker-compose pull && docker-compose up -d
yes | docker image prune
rm -rf /www/server/nginx/proxy_cache_dir/*
rm -rf /www/server/nginx/proxy_temp_dir/*
rm -rf /www/server/nginx/proxy_cache_dir/* || true
rm -rf /www/server/nginx/proxy_temp_dir/* || true
sleep 2
#tccli cdn PurgePathCache --cli-unfold-argument --Paths '${{ secrets.WEB_URL }}' --FlushType delete
deploy-ty:

View File

@ -102,8 +102,8 @@ import Image from "next/image";
import { useAllModels } from "../utils/hooks";
import { MultimodalContent } from "../client/api";
import { getTokenLength } from "@/lib/utils";
import VoiceInput from "@/app/components/voice-input";
import VoiceInput from "./voice-input";
// import GptPrompts from "./gpt-prompts";
// const VoiceInput = dynamic(
// () => import('@/app/components/voice-input'), { ssr: false });
@ -1636,6 +1636,7 @@ function _Chat() {
</div>
<div className={styles["chat-input-panel"]}>
{/*<GptPrompts />*/}
<PromptHints prompts={promptHints} onPromptSelect={onPromptSelect} />
<ChatActions

View File

@ -0,0 +1,8 @@
//@tailwind base;
//@tailwind components;
//@tailwind utilities;
.opacity_span {
opacity: 1;
transform: none;
}

View File

@ -0,0 +1,162 @@
import styles from "./gpt-prompts.module.scss";
import { Flex, Radio, Card } from "antd";
export default function GptPrompts() {
return (
<div className="absolute bottom-full left-0 right-0">
<div className="relative h-full w-full">
<div className="h-full flex ml-1 md:w-full md:m-auto md:mb-4 gap-0 md:gap-2 justify-center">
<div className="grow">
<div className="absolute bottom-full left-0 mb-4 flex w-full grow gap-2 px-1 pb-1 sm:px-2 sm:pb-0 md:static md:mb-0 md:max-w-none">
<div className="grid w-full grid-flow-row grid-cols-[repeat(auto-fit,minmax(250px,1fr))] gap-2">
<Flex>
<Flex vertical>
<span className={styles["opacity_span"]}>
<button className="btn relative btn-neutral group w-full whitespace-nowrap rounded-xl px-4 py-3 text-left text-token-text-primary md:whitespace-normal">
<div className="flex w-full gap-2 items-center justify-center">
<div className="flex w-full items-center justify-between">
<Card title="比较营销策略" bordered={false}>
Z
</Card>
<div className="absolute bottom-0 right-0 top-0 flex items-center rounded-xl bg-gradient-to-l from-token-main-surface-secondary pl-6 pr-4 text-token-text-secondary opacity-0 can-hover:group-hover:opacity-100">
<span className="" data-state="closed">
<div className="rounded-lg bg-token-main-surface-primary p-1 shadow-xxs dark:shadow-none">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
className="icon-sm text-token-text-primary"
>
<path
d="M7 11L12 6L17 11M12 18V7"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
></path>
</svg>
</div>
</span>
</div>
</div>
</div>
</button>
</span>
<span className={styles["opacity_span"]}>
<button className="btn relative btn-neutral group w-full whitespace-nowrap rounded-xl px-4 py-3 text-left text-token-text-primary md:whitespace-normal">
<div className="flex w-full gap-2 items-center justify-center">
<div className="flex w-full items-center justify-between">
<div className="flex flex-col overflow-hidden">
<div className="truncate"></div>
<div className="truncate font-normal opacity-50">
</div>
</div>
<div className="absolute bottom-0 right-0 top-0 flex items-center rounded-xl bg-gradient-to-l from-token-main-surface-secondary pl-6 pr-4 text-token-text-secondary opacity-0 can-hover:group-hover:opacity-100">
<span className="" data-state="closed">
<div className="rounded-lg bg-token-main-surface-primary p-1 shadow-xxs dark:shadow-none">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
className="icon-sm text-token-text-primary"
>
<path
d="M7 11L12 6L17 11M12 18V7"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
></path>
</svg>
</div>
</span>
</div>
</div>
</div>
</button>
</span>
</Flex>
<Flex vertical>
<span className={styles["opacity_span"]}>
<button className="btn relative btn-neutral group w-full whitespace-nowrap rounded-xl px-4 py-3 text-left text-token-text-primary md:whitespace-normal">
<div className="flex w-full gap-2 items-center justify-center">
<div className="flex w-full items-center justify-between">
<div className="flex flex-col overflow-hidden">
<div className="truncate"></div>
<div className="truncate font-normal opacity-50">
Z
</div>
</div>
<div className="absolute bottom-0 right-0 top-0 flex items-center rounded-xl bg-gradient-to-l from-token-main-surface-secondary pl-6 pr-4 text-token-text-secondary opacity-0 can-hover:group-hover:opacity-100">
<span className="" data-state="closed">
<div className="rounded-lg bg-token-main-surface-primary p-1 shadow-xxs dark:shadow-none">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
className="icon-sm text-token-text-primary"
>
<path
d="M7 11L12 6L17 11M12 18V7"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
></path>
</svg>
</div>
</span>
</div>
</div>
</div>
</button>
</span>
<span className={styles["opacity_span"]}>
<button className="btn relative btn-neutral group w-full whitespace-nowrap rounded-xl px-4 py-3 text-left text-token-text-primary md:whitespace-normal">
<div className="flex w-full gap-2 items-center justify-center">
<div className="flex w-full items-center justify-between">
<div className="flex flex-col overflow-hidden">
<div className="truncate"></div>
<div className="truncate font-normal opacity-50">
</div>
</div>
<div className="absolute bottom-0 right-0 top-0 flex items-center rounded-xl bg-gradient-to-l from-token-main-surface-secondary pl-6 pr-4 text-token-text-secondary opacity-0 can-hover:group-hover:opacity-100">
<span className="" data-state="closed">
<div className="rounded-lg bg-token-main-surface-primary p-1 shadow-xxs dark:shadow-none">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
className="icon-sm text-token-text-primary"
>
<path
d="M7 11L12 6L17 11M12 18V7"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
></path>
</svg>
</div>
</span>
</div>
</div>
</div>
</button>
</span>
</Flex>
</Flex>
</div>
</div>
</div>
</div>
</div>
</div>
);
}

View File

@ -50,6 +50,7 @@
"remark-gfm": "^4.0.0",
"remark-math": "^6.0.0",
"sass": "^1.70.0",
"sharp": "^0.33.3",
"spark-md5": "^3.0.2",
"tailwind-merge": "^2.2.1",
"tiktoken": "^1.0.13",

View File

@ -10,7 +10,9 @@ yarn config delete sharp_binary_host
yarn config delete sharp_libvips_binary_host
#yarn cache clean
yarn install
#yarn install
npm i cnpm
cnpm i
yarn run build
mkdir -p "./node_modules/tiktoken"