-
- {users.slice(0, 4).map((user) => {
- const avatarData = getAvatarData(user.name);
- return (
-
-
-
-
- {'avatar' in user && user.avatar ? (
-
- ) : (
-
- {avatarData.text}
-
- )}
-
-
-
- {user.name}
-
-
-
- );
- })}
- {users.length > 4 && (
-
- +{users.length - 4}
-
- )}
+
+
+ {/* Main Chat Area */}
+
+
+
+
-
+
+
+ {/* Input Area */}
+
+
+ {messages.length > 0 && (
+
+
+
+
+
+
+ 分享聊天记录
+
+
+
+ )}
+
setInputMessage(e.target.value)}
+ onKeyPress={(e) => e.key === 'Enter' && handleSendMessage()}
+ />
+
-
-
- {/* Main Chat Area */}
-
-
-
- {messages.map((message) => (
-
- {message.sender.name !== "我" && (
-
- {'avatar' in message.sender && message.sender.avatar ? (
-
- ) : (
-
- {message.sender.name[0]}
-
- )}
-
- )}
-
-
{message.sender.name}
-
-
- {message.content}
-
- {message.isAI && isTyping && currentMessageRef.current === message.id && (
- ▋
- )}
-
-
- {message.sender.name === "我" && (
-
- {'avatar' in message.sender && message.sender.avatar ? (
-
- ) : (
-
- {message.sender.name[0]}
-
- )}
-
- )}
-
- ))}
-
- {/* 添加一个二维码 */}
-
-

-
扫码体验AI群聊
-
-
-
-
-
- {/* Input Area */}
-
-
- {messages.length > 0 && (
-
-
-
-
-
-
- 分享聊天记录
-
-
-
- )}
-
setInputMessage(e.target.value)}
- onKeyPress={(e) => e.key === 'Enter' && handleSendMessage()}
- />
-
-
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
new file mode 100644
index 0000000..7b17179
--- /dev/null
+++ b/src/components/Header.tsx
@@ -0,0 +1,38 @@
+import React, { useEffect } from 'react';
+import GitHubButton from 'react-github-btn';
+import '@fontsource/audiowide';
+
+
+
+const Header: React.FC = () => {
+ return (
+
+ );
+};
+
+export default Header;
\ No newline at end of file
diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx
index d153d13..c417600 100644
--- a/src/components/Layout.tsx
+++ b/src/components/Layout.tsx
@@ -1,23 +1,16 @@
-interface LayoutProps {
- children: React.ReactNode
-}
+import React from 'react';
+import Header from './Header';
-function Layout({ children }: LayoutProps) {
+const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
return (
-
-
-
-
- {children}
-
-
-
+
- )
-}
+ );
+};
-export default Layout
\ No newline at end of file
+export default Layout;
\ No newline at end of file
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
new file mode 100644
index 0000000..a879de7
--- /dev/null
+++ b/src/components/Sidebar.tsx
@@ -0,0 +1,170 @@
+import React from 'react';
+import { Button } from "@/components/ui/button";
+import { MessageSquareIcon, PlusCircleIcon, MenuIcon, PanelLeftCloseIcon } from "lucide-react";
+import { cn } from "@/lib/utils";
+import GitHubButton from 'react-github-btn';
+import '@fontsource/audiowide';
+import { groups } from "@/config/groups";
+import { AdSection } from './AdSection';
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+
+// 根据群组ID生成固定的随机颜色
+const getRandomColor = (index: number) => {
+ const colors = ['blue', 'green', 'yellow', 'purple', 'pink', 'indigo', 'red', 'orange', 'teal'];
+ //增加hash
+ const hashCode = index.toString().split('').reduce((acc, char) => {
+ return char.charCodeAt(0) + ((acc << 5) - acc);
+ }, 0);
+ return colors[hashCode % colors.length];
+};
+
+interface SidebarProps {
+ isOpen: boolean;
+ toggleSidebar: () => void;
+ selectedGroupIndex?: number;
+ onSelectGroup?: (index: number) => void;
+}
+
+const Sidebar = ({ isOpen, toggleSidebar, selectedGroupIndex = 0, onSelectGroup }: SidebarProps) => {
+
+ return (
+ <>
+ {/* 侧边栏 - 在移动设备上可以隐藏,在桌面上始终显示 */}
+
+
+
+
+
+ 群列表
+
+
+
+
+
+
+
+ {/* 广告位 */}
+
+
+ {/* GitHub Star Button - 只在侧边栏打开时显示,放在底部 */}
+
+ {/* 标题移至底部 */}
+
+
+ {isOpen && (
+
+
+ Star
+
+
+ )}
+
+
+
+
+ {/* 移动设备上的遮罩层,点击时关闭侧边栏 */}
+ {isOpen && (
+
+ )}
+ >
+ );
+};
+
+export default Sidebar;
\ No newline at end of file
diff --git a/src/components/ui/popover.tsx b/src/components/ui/popover.tsx
new file mode 100644
index 0000000..8577b8a
--- /dev/null
+++ b/src/components/ui/popover.tsx
@@ -0,0 +1,29 @@
+import * as React from "react"
+import * as PopoverPrimitive from "@radix-ui/react-popover"
+
+import { cn } from "@/lib/utils"
+
+const Popover = PopoverPrimitive.Root
+
+const PopoverTrigger = PopoverPrimitive.Trigger
+
+const PopoverContent = React.forwardRef<
+ React.ElementRef
,
+ React.ComponentPropsWithoutRef
+>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
+
+
+
+))
+PopoverContent.displayName = PopoverPrimitive.Content.displayName
+
+export { Popover, PopoverTrigger, PopoverContent }
\ No newline at end of file
diff --git a/src/components/ui/separator.tsx b/src/components/ui/separator.tsx
new file mode 100644
index 0000000..6d7f122
--- /dev/null
+++ b/src/components/ui/separator.tsx
@@ -0,0 +1,29 @@
+import * as React from "react"
+import * as SeparatorPrimitive from "@radix-ui/react-separator"
+
+import { cn } from "@/lib/utils"
+
+const Separator = React.forwardRef<
+ React.ElementRef,
+ React.ComponentPropsWithoutRef
+>(
+ (
+ { className, orientation = "horizontal", decorative = true, ...props },
+ ref
+ ) => (
+
+ )
+)
+Separator.displayName = SeparatorPrimitive.Root.displayName
+
+export { Separator }
diff --git a/src/components/ui/sidebar.tsx b/src/components/ui/sidebar.tsx
new file mode 100644
index 0000000..dcf03e0
--- /dev/null
+++ b/src/components/ui/sidebar.tsx
@@ -0,0 +1,761 @@
+import * as React from "react"
+import { Slot } from "@radix-ui/react-slot"
+import { VariantProps, cva } from "class-variance-authority"
+import { PanelLeft } from "lucide-react"
+
+import { useIsMobile } from "@/hooks/use-mobile"
+import { cn } from "@/lib/utils"
+import { Button } from "@/components/ui/button"
+import { Input } from "@/components/ui/input"
+import { Separator } from "@/components/ui/separator"
+import { Sheet, SheetContent } from "@/components/ui/sheet"
+import { Skeleton } from "@/components/ui/skeleton"
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip"
+
+const SIDEBAR_COOKIE_NAME = "sidebar_state"
+const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
+const SIDEBAR_WIDTH = "16rem"
+const SIDEBAR_WIDTH_MOBILE = "18rem"
+const SIDEBAR_WIDTH_ICON = "3rem"
+const SIDEBAR_KEYBOARD_SHORTCUT = "b"
+
+type SidebarContext = {
+ state: "expanded" | "collapsed"
+ open: boolean
+ setOpen: (open: boolean) => void
+ openMobile: boolean
+ setOpenMobile: (open: boolean) => void
+ isMobile: boolean
+ toggleSidebar: () => void
+}
+
+const SidebarContext = React.createContext(null)
+
+function useSidebar() {
+ const context = React.useContext(SidebarContext)
+ if (!context) {
+ throw new Error("useSidebar must be used within a SidebarProvider.")
+ }
+
+ return context
+}
+
+const SidebarProvider = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div"> & {
+ defaultOpen?: boolean
+ open?: boolean
+ onOpenChange?: (open: boolean) => void
+ }
+>(
+ (
+ {
+ defaultOpen = true,
+ open: openProp,
+ onOpenChange: setOpenProp,
+ className,
+ style,
+ children,
+ ...props
+ },
+ ref
+ ) => {
+ const isMobile = useIsMobile()
+ const [openMobile, setOpenMobile] = React.useState(false)
+
+ // This is the internal state of the sidebar.
+ // We use openProp and setOpenProp for control from outside the component.
+ const [_open, _setOpen] = React.useState(defaultOpen)
+ const open = openProp ?? _open
+ const setOpen = React.useCallback(
+ (value: boolean | ((value: boolean) => boolean)) => {
+ const openState = typeof value === "function" ? value(open) : value
+ if (setOpenProp) {
+ setOpenProp(openState)
+ } else {
+ _setOpen(openState)
+ }
+
+ // This sets the cookie to keep the sidebar state.
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
+ },
+ [setOpenProp, open]
+ )
+
+ // Helper to toggle the sidebar.
+ const toggleSidebar = React.useCallback(() => {
+ return isMobile
+ ? setOpenMobile((open) => !open)
+ : setOpen((open) => !open)
+ }, [isMobile, setOpen, setOpenMobile])
+
+ // Adds a keyboard shortcut to toggle the sidebar.
+ React.useEffect(() => {
+ const handleKeyDown = (event: KeyboardEvent) => {
+ if (
+ event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
+ (event.metaKey || event.ctrlKey)
+ ) {
+ event.preventDefault()
+ toggleSidebar()
+ }
+ }
+
+ window.addEventListener("keydown", handleKeyDown)
+ return () => window.removeEventListener("keydown", handleKeyDown)
+ }, [toggleSidebar])
+
+ // We add a state so that we can do data-state="expanded" or "collapsed".
+ // This makes it easier to style the sidebar with Tailwind classes.
+ const state = open ? "expanded" : "collapsed"
+
+ const contextValue = React.useMemo(
+ () => ({
+ state,
+ open,
+ setOpen,
+ isMobile,
+ openMobile,
+ setOpenMobile,
+ toggleSidebar,
+ }),
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
+ )
+
+ return (
+
+
+
+ {children}
+
+
+
+ )
+ }
+)
+SidebarProvider.displayName = "SidebarProvider"
+
+const Sidebar = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div"> & {
+ side?: "left" | "right"
+ variant?: "sidebar" | "floating" | "inset"
+ collapsible?: "offcanvas" | "icon" | "none"
+ }
+>(
+ (
+ {
+ side = "left",
+ variant = "sidebar",
+ collapsible = "offcanvas",
+ className,
+ children,
+ ...props
+ },
+ ref
+ ) => {
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
+
+ if (collapsible === "none") {
+ return (
+
+ {children}
+
+ )
+ }
+
+ if (isMobile) {
+ return (
+
+
+ {children}
+
+
+ )
+ }
+
+ return (
+
+ {/* This is what handles the sidebar gap on desktop */}
+
+
+
+ )
+ }
+)
+Sidebar.displayName = "Sidebar"
+
+const SidebarTrigger = React.forwardRef<
+ React.ElementRef,
+ React.ComponentProps
+>(({ className, onClick, ...props }, ref) => {
+ const { toggleSidebar } = useSidebar()
+
+ return (
+
+ )
+})
+SidebarTrigger.displayName = "SidebarTrigger"
+
+const SidebarRail = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentProps<"button">
+>(({ className, ...props }, ref) => {
+ const { toggleSidebar } = useSidebar()
+
+ return (
+
+ )
+})
+SidebarRail.displayName = "SidebarRail"
+
+const SidebarInset = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"main">
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarInset.displayName = "SidebarInset"
+
+const SidebarInput = React.forwardRef<
+ React.ElementRef,
+ React.ComponentProps
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarInput.displayName = "SidebarInput"
+
+const SidebarHeader = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div">
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarHeader.displayName = "SidebarHeader"
+
+const SidebarFooter = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div">
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarFooter.displayName = "SidebarFooter"
+
+const SidebarSeparator = React.forwardRef<
+ React.ElementRef,
+ React.ComponentProps
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarSeparator.displayName = "SidebarSeparator"
+
+const SidebarContent = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div">
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarContent.displayName = "SidebarContent"
+
+const SidebarGroup = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div">
+>(({ className, ...props }, ref) => {
+ return (
+
+ )
+})
+SidebarGroup.displayName = "SidebarGroup"
+
+const SidebarGroupLabel = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div"> & { asChild?: boolean }
+>(({ className, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "div"
+
+ return (
+ svg]:size-4 [&>svg]:shrink-0",
+ "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
+ className
+ )}
+ {...props}
+ />
+ )
+})
+SidebarGroupLabel.displayName = "SidebarGroupLabel"
+
+const SidebarGroupAction = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentProps<"button"> & { asChild?: boolean }
+>(({ className, asChild = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+
+ return (
+ svg]:size-4 [&>svg]:shrink-0",
+ // Increases the hit area of the button on mobile.
+ "after:absolute after:-inset-2 after:md:hidden",
+ "group-data-[collapsible=icon]:hidden",
+ className
+ )}
+ {...props}
+ />
+ )
+})
+SidebarGroupAction.displayName = "SidebarGroupAction"
+
+const SidebarGroupContent = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div">
+>(({ className, ...props }, ref) => (
+
+))
+SidebarGroupContent.displayName = "SidebarGroupContent"
+
+const SidebarMenu = React.forwardRef<
+ HTMLUListElement,
+ React.ComponentProps<"ul">
+>(({ className, ...props }, ref) => (
+
+))
+SidebarMenu.displayName = "SidebarMenu"
+
+const SidebarMenuItem = React.forwardRef<
+ HTMLLIElement,
+ React.ComponentProps<"li">
+>(({ className, ...props }, ref) => (
+
+))
+SidebarMenuItem.displayName = "SidebarMenuItem"
+
+const sidebarMenuButtonVariants = cva(
+ "peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
+ outline:
+ "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
+ },
+ size: {
+ default: "h-8 text-sm",
+ sm: "h-7 text-xs",
+ lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0",
+ },
+ },
+ defaultVariants: {
+ variant: "default",
+ size: "default",
+ },
+ }
+)
+
+const SidebarMenuButton = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentProps<"button"> & {
+ asChild?: boolean
+ isActive?: boolean
+ tooltip?: string | React.ComponentProps
+ } & VariantProps
+>(
+ (
+ {
+ asChild = false,
+ isActive = false,
+ variant = "default",
+ size = "default",
+ tooltip,
+ className,
+ ...props
+ },
+ ref
+ ) => {
+ const Comp = asChild ? Slot : "button"
+ const { isMobile, state } = useSidebar()
+
+ const button = (
+
+ )
+
+ if (!tooltip) {
+ return button
+ }
+
+ if (typeof tooltip === "string") {
+ tooltip = {
+ children: tooltip,
+ }
+ }
+
+ return (
+
+ {button}
+
+
+ )
+ }
+)
+SidebarMenuButton.displayName = "SidebarMenuButton"
+
+const SidebarMenuAction = React.forwardRef<
+ HTMLButtonElement,
+ React.ComponentProps<"button"> & {
+ asChild?: boolean
+ showOnHover?: boolean
+ }
+>(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
+ const Comp = asChild ? Slot : "button"
+
+ return (
+ svg]:size-4 [&>svg]:shrink-0",
+ // Increases the hit area of the button on mobile.
+ "after:absolute after:-inset-2 after:md:hidden",
+ "peer-data-[size=sm]/menu-button:top-1",
+ "peer-data-[size=default]/menu-button:top-1.5",
+ "peer-data-[size=lg]/menu-button:top-2.5",
+ "group-data-[collapsible=icon]:hidden",
+ showOnHover &&
+ "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
+ className
+ )}
+ {...props}
+ />
+ )
+})
+SidebarMenuAction.displayName = "SidebarMenuAction"
+
+const SidebarMenuBadge = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div">
+>(({ className, ...props }, ref) => (
+
+))
+SidebarMenuBadge.displayName = "SidebarMenuBadge"
+
+const SidebarMenuSkeleton = React.forwardRef<
+ HTMLDivElement,
+ React.ComponentProps<"div"> & {
+ showIcon?: boolean
+ }
+>(({ className, showIcon = false, ...props }, ref) => {
+ // Random width between 50 to 90%.
+ const width = React.useMemo(() => {
+ return `${Math.floor(Math.random() * 40) + 50}%`
+ }, [])
+
+ return (
+
+ {showIcon && (
+
+ )}
+
+
+ )
+})
+SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton"
+
+const SidebarMenuSub = React.forwardRef<
+ HTMLUListElement,
+ React.ComponentProps<"ul">
+>(({ className, ...props }, ref) => (
+
+))
+SidebarMenuSub.displayName = "SidebarMenuSub"
+
+const SidebarMenuSubItem = React.forwardRef<
+ HTMLLIElement,
+ React.ComponentProps<"li">
+>(({ ...props }, ref) => )
+SidebarMenuSubItem.displayName = "SidebarMenuSubItem"
+
+const SidebarMenuSubButton = React.forwardRef<
+ HTMLAnchorElement,
+ React.ComponentProps<"a"> & {
+ asChild?: boolean
+ size?: "sm" | "md"
+ isActive?: boolean
+ }
+>(({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
+ const Comp = asChild ? Slot : "a"
+
+ return (
+ span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
+ "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
+ size === "sm" && "text-xs",
+ size === "md" && "text-sm",
+ "group-data-[collapsible=icon]:hidden",
+ className
+ )}
+ {...props}
+ />
+ )
+})
+SidebarMenuSubButton.displayName = "SidebarMenuSubButton"
+
+export {
+ Sidebar,
+ SidebarContent,
+ SidebarFooter,
+ SidebarGroup,
+ SidebarGroupAction,
+ SidebarGroupContent,
+ SidebarGroupLabel,
+ SidebarHeader,
+ SidebarInput,
+ SidebarInset,
+ SidebarMenu,
+ SidebarMenuAction,
+ SidebarMenuBadge,
+ SidebarMenuButton,
+ SidebarMenuItem,
+ SidebarMenuSkeleton,
+ SidebarMenuSub,
+ SidebarMenuSubButton,
+ SidebarMenuSubItem,
+ SidebarProvider,
+ SidebarRail,
+ SidebarSeparator,
+ SidebarTrigger,
+ useSidebar,
+}
diff --git a/src/components/ui/skeleton.tsx b/src/components/ui/skeleton.tsx
new file mode 100644
index 0000000..d7e45f7
--- /dev/null
+++ b/src/components/ui/skeleton.tsx
@@ -0,0 +1,15 @@
+import { cn } from "@/lib/utils"
+
+function Skeleton({
+ className,
+ ...props
+}: React.HTMLAttributes) {
+ return (
+
+ )
+}
+
+export { Skeleton }
diff --git a/src/config/aiCharacters.ts b/src/config/aiCharacters.ts
index f25d5cb..faa58e9 100644
--- a/src/config/aiCharacters.ts
+++ b/src/config/aiCharacters.ts
@@ -6,25 +6,50 @@ export const modelConfigs = [
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
},
{
- model: "deepseek-v3",
- apiKey: "DASHSCOPE_API_KEY",
- baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
- },
- {
- model: "hunyuan-standard",
- apiKey: "HUNYUAN_API_KEY",
- baseURL: "https://api.hunyuan.cloud.tencent.com/v1"
- },
- {
- model: "ep-20250217191935-wzj8l",//火山引擎接入点(改成自己的)
+ model: "deepseek-v3-241226",
apiKey: "ARK_API_KEY",
baseURL: "https://ark.cn-beijing.volces.com/api/v3"
},
{
- model: "hunyuan-lite",//免费模型
- apiKey: "HUNYUAN_API_KEY",
+ model: "hunyuan-turbos-latest",
+ apiKey: "HUNYUAN_API_KEY1",
baseURL: "https://api.hunyuan.cloud.tencent.com/v1"
},
+ {
+ model: "doubao-1-5-lite-32k-250115",//豆包模型|火山引擎接入点(改成自己的)
+ apiKey: "ARK_API_KEY",
+ baseURL: "https://ark.cn-beijing.volces.com/api/v3"
+ },
+ {
+ model: "ep-20250306223646-szzkw",//deepseekv火山引擎接入点(改成自己的)
+ apiKey: "ARK_API_KEY1",
+ baseURL: "https://ark.cn-beijing.volces.com/api/v3"
+ },
+ {
+ model: "glm-4-plus",
+ apiKey: "GLM_API_KEY",
+ baseURL: "https://open.bigmodel.cn/api/paas/v4/"
+ },
+ {
+ model: "qwen-turbo",//调度模型
+ apiKey: "DASHSCOPE_API_KEY", // 这里存储环境变量的 key 名称
+ baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1"
+ },
+ {
+ model: "deepseek-chat",
+ apiKey: "DEEPSEEK_API_KEY",
+ baseURL: "https://api.deepseek.com/v1"
+ },
+ {
+ model: "moonshot-v1-8k",
+ apiKey: "KIMI_API_KEY",
+ baseURL: "https://api.moonshot.cn/v1"
+ },
+ {
+ model: "ernie-3.5-128k",
+ apiKey: "BAIDU_API_KEY",
+ baseURL: "https://qianfan.baidubce.com/v2"
+ }
] as const;
export type ModelType = typeof modelConfigs[number]["model"];
@@ -104,7 +129,7 @@ export function generateAICharacters(groupName: string): AICharacter[] {
model: modelConfigs[2].model,
avatar: "/img/yuanbao.png",
custom_prompt: `你是一个名叫"元宝"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
- tags: ["微信生态", "新闻报道", "文字游戏", "生活助手", "娱乐", "信息总结"]
+ tags: ["微信", "聊天", "新闻报道", "文字游戏","命令", "娱乐", "信息总结"]
},
{
id: 'ai5',
@@ -113,7 +138,7 @@ export function generateAICharacters(groupName: string): AICharacter[] {
model: modelConfigs[3].model,
avatar: "/img/doubao_new.png",
custom_prompt: `你是一个名叫"豆包"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
- tags: ["生活助手", "文字游戏", "学生", "娱乐", "抖音"]
+ tags: ["聊天", "文字游戏", "学生", "娱乐", "命令"]
},
{
id: 'ai6',
@@ -122,16 +147,43 @@ export function generateAICharacters(groupName: string): AICharacter[] {
model: modelConfigs[0].model,
avatar: "/img/qwen.jpg",
custom_prompt: `你是一个名叫"千问"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
- tags: ["广告文案","分析数据","文字游戏","信息总结", "阿里"]
+ tags: ["广告文案","分析数据","文字游戏","信息总结", "聊天", "命令"]
},
{
id: 'ai7',
name: "DeepSeek",
- personality: "deepseek-r1",
- model: modelConfigs[3].model,
+ personality: "deepseek-V3",
+ model: modelConfigs[1].model,
avatar: "/img/ds.svg",
custom_prompt: `你是一个名叫"DeepSeek"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
- tags: ["深度推理", "编程", "文字游戏", "数学", "信息总结"]
+ tags: ["深度推理", "编程", "文字游戏", "数学", "信息总结", "聊天", "命令"]
+ },
+ {
+ id: 'ai8',
+ name: "智谱",
+ personality: "glm",
+ model: modelConfigs[5].model,
+ avatar: "/img/glm.gif",
+ custom_prompt: `你是一个名叫"智谱"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
+ tags: ["深度推理","数学","信息总结", "分析数据","文字游戏", "聊天", "命令"]
+ },
+ {
+ id: 'ai9',
+ name: "Kimi",
+ personality: "kimi",
+ model: modelConfigs[8].model,
+ avatar: "/img/kimi.jpg",
+ custom_prompt: `你是一个名叫"Kimi"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
+ tags: ["深度推理","数学","信息总结", "分析数据","文字游戏", "聊天", "命令"]
+ },
+ {
+ id: 'ai10',
+ name: "文小言",
+ personality: "baidu",
+ model: modelConfigs[9].model,
+ avatar: "/img/baidu.svg",
+ custom_prompt: `你是一个名叫"文心一言"的硅基生命体,你当前在一个叫"${groupName}" 的聊天群里`,
+ tags: ["深度推理","数学","信息总结", "分析数据","文字游戏", "聊天", "命令"]
}
];
}
diff --git a/src/config/groups.ts b/src/config/groups.ts
index 2643ddf..f50cf3a 100644
--- a/src/config/groups.ts
+++ b/src/config/groups.ts
@@ -4,19 +4,29 @@ export interface Group {
name: string;
description: string;
members: string[];
+ isGroupDiscussionMode: boolean;
}
export const groups: Group[] = [
{
id: 'group1',
- name: '硅碳摸鱼交流群',
- description: '硅碳摸鱼交流群',
- members: ['ai1', 'ai2', 'ai3']
+ name: '🔥硅碳生命体交流群',
+ description: '群消息关注度权重:“user”的最新消息>其他成员最新消息>“user”的历史消息>其他成员历史消息>',
+ members: [ 'ai8', 'ai5', 'ai6', 'ai7', 'ai9', 'ai10', 'ai4'],
+ isGroupDiscussionMode: false
},
{
id: 'group2',
- name: '硅碳生命体交流群',
- description: '硅碳生命体交流群',
- members: ['ai4', 'ai5', 'ai6', 'ai7']
+ name: '🎯AI成语接龙游戏群',
+ description: '可以适当打招呼问候自我介绍 #注意:本群主线是成语接龙游戏,请严格按照文字成语接龙规则,不能过度闲聊,一旦游戏开始不要过度解释,只允许回复1条成语',
+ isGroupDiscussionMode: true,
+ members: [ 'ai8', 'ai5', 'ai6', 'ai7', 'ai9', 'ai10', 'ai4'],
+ },
+ {
+ id: 'group3',
+ name: '💕AI树洞倾诉群',
+ description: '做一个温暖贴心的倾听者。当用户分享烦恼或秘密时,请表现出理解和同理心,提供情感支持而非简单建议。避免评判,保持尊重,适当提问以帮助用户更好地表达自己。记住,你的角色是提供安全的倾诉空间,而不是解决所有问题。',
+ isGroupDiscussionMode: true,
+ members: [ 'ai8','ai5', 'ai6', 'ai9', 'ai10'],
}
];
diff --git a/src/hooks/use-mobile.tsx b/src/hooks/use-mobile.tsx
new file mode 100644
index 0000000..2b0fe1d
--- /dev/null
+++ b/src/hooks/use-mobile.tsx
@@ -0,0 +1,19 @@
+import * as React from "react"
+
+const MOBILE_BREAKPOINT = 768
+
+export function useIsMobile() {
+ const [isMobile, setIsMobile] = React.useState(undefined)
+
+ React.useEffect(() => {
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
+ const onChange = () => {
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
+ }
+ mql.addEventListener("change", onChange)
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
+ return () => mql.removeEventListener("change", onChange)
+ }, [])
+
+ return !!isMobile
+}
diff --git a/src/index.css b/src/index.css
index de4587f..2a5b1ac 100644
--- a/src/index.css
+++ b/src/index.css
@@ -56,7 +56,23 @@
--chart-5: 27 87% 67%;
--radius: 0.5rem
- }
+ ;
+
+ --sidebar-background: 0 0% 98%;
+
+ --sidebar-foreground: 240 5.3% 26.1%;
+
+ --sidebar-primary: 240 5.9% 10%;
+
+ --sidebar-primary-foreground: 0 0% 98%;
+
+ --sidebar-accent: 240 4.8% 95.9%;
+
+ --sidebar-accent-foreground: 240 5.9% 10%;
+
+ --sidebar-border: 220 13% 91%;
+
+ --sidebar-ring: 217.2 91.2% 59.8%}
.dark {
--background: 0 0% 3.9%;
@@ -106,7 +122,23 @@
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%
- }
+ ;
+
+ --sidebar-background: 240 5.9% 10%;
+
+ --sidebar-foreground: 240 4.8% 95.9%;
+
+ --sidebar-primary: 224.3 76.3% 48%;
+
+ --sidebar-primary-foreground: 0 0% 100%;
+
+ --sidebar-accent: 240 3.7% 15.9%;
+
+ --sidebar-accent-foreground: 240 4.8% 95.9%;
+
+ --sidebar-border: 240 3.7% 15.9%;
+
+ --sidebar-ring: 217.2 91.2% 59.8%}
}
@layer base {
diff --git a/tailwind.config.js b/tailwind.config.js
index 02f400e..609087a 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -49,6 +49,16 @@ module.exports = {
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))'
+ },
+ sidebar: {
+ DEFAULT: 'hsl(var(--sidebar-background))',
+ foreground: 'hsl(var(--sidebar-foreground))',
+ primary: 'hsl(var(--sidebar-primary))',
+ 'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
+ accent: 'hsl(var(--sidebar-accent))',
+ 'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
+ border: 'hsl(var(--sidebar-border))',
+ ring: 'hsl(var(--sidebar-ring))'
}
}
}
diff --git a/warngler.toml b/warngler.toml
new file mode 100644
index 0000000..829ef71
--- /dev/null
+++ b/warngler.toml
@@ -0,0 +1,3 @@
+[observability]
+enabled = true
+head_sampling_rate = 1 # optional. default = 1.
\ No newline at end of file