Commit 960c8898 by Archer Committed by GitHub

docs: switch to docs layout and apply black theme (#6533)

* feat: add Gemini 3.1 models

- Add gemini-3.1-pro-preview (released February 19, 2026)
- Add gemini-3.1-flash-lite-preview (released March 3, 2026)

Both models support:
- 1M context window
- 64k max response
- Vision
- Tool choice

* docs: switch to docs layout and apply black theme

- Change layout from notebook to docs
- Update logo to icon + text format
- Apply fumadocs black theme
- Simplify global.css (keep only navbar and TOC styles)
- Fix icon components to properly accept className props
- Add mobile text overflow handling
- Update Node engine requirement to >=20.x

* doc

* doc

* lock

* fix: ts

* doc

* doc

---------

Co-authored-by: archer <archer@archerdeMac-mini.local>
Co-authored-by: archer <545436317@qq.com>
parent 2f183a99
import { type ReactNode } from 'react';
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/notebook';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/app/layout.config';
import { t, getLocalizedPath, i18n } from '@/lib/i18n';
import LogoLight from '@/components/docs/logo';
import LogoDark from '@/components/docs/logoDark';
import '@/app/global.css';
import { CustomSidebarComponents } from '@/components/sideBar';
import { SidebarKeepOpen } from '@/components/sidebarKeepOpen';
import { SidebarScrollFix } from '@/components/sidebarScrollFix';
import FeishuLogoLight from '@/components/docs/feishuLogoLIght';
import FeishuLogoDark from '@/components/docs/feishuLogoDark';
import GithubLogoLight from '@/components/docs/githubLogoLight';
import GithubLogoDark from '@/components/docs/githubLogoDark';
import { BookOpen, Code, Lightbulb, CircleHelp, Scale, History, Server } from 'lucide-react';
import { BookOpen, Code, Lightbulb, CircleHelp, Server } from 'lucide-react';
export default async function Layout({
params,
......@@ -57,63 +56,32 @@ export default async function Layout({
return (
<DocsLayout
{...baseOptions(lang)}
nav={{
title: (
<div className="flex flex-row items-center gap-2 h-14 ml-1">
<div className="block dark:hidden">
<LogoLight className="w-48 h-auto" />
</div>
<div className="hidden dark:block">
<LogoDark className="w-48 h-auto" />
</div>
</div>
),
mode: 'top'
tree={source.pageTree[lang] || source.pageTree[i18n.defaultLanguage]}
searchToggle={{
enabled: true
}}
sidebar={{
tabs: tab,
collapsible: false,
components: CustomSidebarComponents
}}
links={[
{
type: 'icon',
icon: (
<div className="flex flex-row items-center gap-2">
<div className="block dark:hidden">
<FeishuLogoLight />
</div>
<div className="hidden dark:block">
<FeishuLogoDark />
</div>
</div>
),
icon: <FeishuLogoLight className="block dark:hidden size-5" />,
url: 'https://oss.laf.run/otnvvf-imgs/fastgpt-feishu1.png',
text: '飞书群'
},
{
type: 'icon',
icon: (
<div className="flex flex-row items-center gap-2">
<div className="block dark:hidden">
<GithubLogoLight />
</div>
<div className="hidden dark:block">
<GithubLogoDark />
</div>
</div>
),
icon: <GithubLogoLight className="block dark:hidden size-5" />,
url: 'https://github.com/labring/FastGPT',
text: 'github'
}
]}
tree={source.pageTree[lang] || source.pageTree[i18n.defaultLanguage]}
searchToggle={{
enabled: true
}}
sidebar={{
tabs: tab,
collapsible: false,
components: CustomSidebarComponents
}}
tabMode="sidebar"
>
<SidebarKeepOpen tabUrls={tabUrls} />
<SidebarScrollFix />
{children}
</DocsLayout>
);
......
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
import { i18n } from '@/lib/i18n';
import Image from 'next/image';
/**
* Shared layout configurations
......@@ -16,10 +17,9 @@ export const baseOptions = (locale: string): BaseLayoutProps => {
},
nav: {
title: (
<div className="flex flex-col">
<div className="flex flex-row items-center gap-2">
<img src="/FastGPT-full.svg" alt="FastGPT" width={49} height={48} />
</div>
<div className="flex flex-row items-center gap-2">
<Image src="/logo.svg" alt="FastGPT" width={30} height={30} />
<span className="font-semibold text-lg">FastGPT</span>
</div>
)
},
......
......@@ -2,8 +2,8 @@
import React from 'react';
const feishuLogoDark: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
const feishuLogoDark: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M17 29C21 29 25 26.9339 28 23.4065C36 14 41.4242 16.8166 44 17.9998C38.5 20.9998 40.5 29.6233 33 35.9998C28.382 39.9259 23.4945 41.014 19 41C12.5231 40.9799 6.86226 37.7637 4 35.4063V16.9998"
stroke="#8b9dc1"
......
......@@ -2,8 +2,8 @@
import React from 'react';
const feishuLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
const feishuLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M17 29C21 29 25 26.9339 28 23.4065C36 14 41.4242 16.8166 44 17.9998C38.5 20.9998 40.5 29.6233 33 35.9998C28.382 39.9259 23.4945 41.014 19 41C12.5231 40.9799 6.86226 37.7637 4 35.4063V16.9998"
stroke="#8a8a8a"
......
......@@ -2,8 +2,8 @@
import React from 'react';
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="98" height="98" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
<path
fillRule="evenodd"
clipRule="evenodd"
......
......@@ -2,8 +2,8 @@
import React from 'react';
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
<svg width="98" height="98" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
const githubLogoLight: React.FC<React.SVGProps<SVGSVGElement>> = ({ className, ...props }) => (
<svg {...props} className={className} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98">
<path
fillRule="evenodd"
clipRule="evenodd"
......
'use client';
import { useEffect } from 'react';
/**
* 修复侧边栏滚动焦点问题
* 当鼠标从内容区移动到侧边栏时,确保滚动事件作用于侧边栏而不是内容区
*/
export function SidebarScrollFix() {
useEffect(() => {
const handleMouseEnter = (e: MouseEvent) => {
const target = e.currentTarget as HTMLElement;
// 鼠标进入侧边栏时,聚焦到侧边栏的滚动容器
if (target) {
target.focus({ preventScroll: true });
}
};
// 桌面端侧边栏
const sidebar = document.querySelector('#nd-sidebar');
// 移动端侧边栏
const sidebarMobile = document.querySelector('#nd-sidebar-mobile');
if (sidebar) {
sidebar.addEventListener('mouseenter', handleMouseEnter as EventListener);
// 确保侧边栏可以接收焦点
(sidebar as HTMLElement).setAttribute('tabindex', '-1');
}
if (sidebarMobile) {
sidebarMobile.addEventListener('mouseenter', handleMouseEnter as EventListener);
(sidebarMobile as HTMLElement).setAttribute('tabindex', '-1');
}
return () => {
if (sidebar) {
sidebar.removeEventListener('mouseenter', handleMouseEnter as EventListener);
}
if (sidebarMobile) {
sidebarMobile.removeEventListener('mouseenter', handleMouseEnter as EventListener);
}
};
}, []);
return null;
}
......@@ -52,7 +52,7 @@
]
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
}
}
......@@ -2,8 +2,8 @@
"name": "@fastgpt/global",
"version": "1.0.0",
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@fastgpt-sdk/plugin": "0.3.8",
......
......@@ -3,8 +3,8 @@
"version": "1.0.0",
"type": "module",
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@fastgpt-sdk/storage": "catalog:",
......
......@@ -2,8 +2,8 @@
"name": "@fastgpt/web",
"version": "1.0.0",
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@chakra-ui/anatomy": "catalog:",
......
// 已使用 json5 进行解析,会自动去掉注释,无需手动去除
{
"feConfigs": {
"lafEnv": "https://laf.dev" // laf环境。 https://laf.run (杭州阿里云) ,或者私有化的laf环境。如果使用 Laf openapi 功能,需要最新版的 laf
},
"systemEnv": {
"vectorMaxProcess": 15, // 向量处理线程数量
"qaMaxProcess": 15, // 问答拆分线程数量
"tokenWorkers": 30, // Token 计算线程保持数,会持续占用内存,不能设置太大。
"hnswEfSearch": 100 // 向量搜索参数,仅对 PG OB 生效。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
},
"llmModels": [
{
"provider": "OpenAI", // 模型提供商,主要用于分类展示,目前已经内置提供商包括:https://github.com/labring/FastGPT/blob/main/packages/global/core/ai/provider.ts, pr 提供新的提供商,或直接填写 Other
"model": "gpt-5", // 模型名(对应OneAPI中渠道的模型名)
"name": "gpt-5", // 模型别名
"maxContext": 128000, // 最大上下文
"maxResponse": 16000, // 最大回复
"quoteMaxToken": 120000, // 最大引用内容
"maxTemperature": 1.2, // 最大温度
"charsPointsPrice": 0, // n积分/1k token(商业版)
"censor": false, // 是否开启敏感校验(商业版)
"vision": true, // 是否支持图片输入
"datasetProcess": true, // 是否设置为文本理解模型(QA),务必保证至少有一个为true,否则知识库会报错
"usedInClassify": true, // 是否用于问题分类(务必保证至少有一个为true
"usedInExtractFields": true, // 是否用于内容提取(务必保证至少有一个为true
"usedInToolCall": true, // 是否用于工具调用(务必保证至少有一个为true
"toolChoice": true, // 是否支持工具选择(分类,内容提取,工具调用会用到。)
"functionCall": false, // 是否支持函数调用(分类,内容提取,工具调用会用到。会优先使用 toolChoice,如果为false,则使用 functionCall,如果仍为 false,则使用提示词模式) // 自定义文本分类提示词(不支持工具和函数调用的模型 // 自定义内容提取提示词
"defaultSystemChatPrompt": "", // 对话默认携带的系统提示词
"defaultConfig": {}, // 请求API时,挟带一些默认配置(比如 GLM4 top_p)
"fieldMap": {} // 字段映射(o1 模型需要把 max_tokens 映射为 max_completion_tokens)
},
{
"provider": "OpenAI",
"model": "gpt-4o",
"name": "gpt-4o",
"maxContext": 128000,
"maxResponse": 4000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": true,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"toolChoice": true,
"functionCall": false,
"defaultSystemChatPrompt": "",
"defaultConfig": {},
"fieldMap": {}
},
{
"provider": "OpenAI",
"model": "o1-mini",
"name": "o1-mini",
"maxContext": 128000,
"maxResponse": 65000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"toolChoice": false,
"functionCall": false,
"defaultSystemChatPrompt": "",
"defaultConfig": {
"temperature": 1,
"max_tokens": null,
"stream": false
}
},
{
"provider": "OpenAI",
"model": "o1-preview",
"name": "o1-preview",
"maxContext": 128000,
"maxResponse": 32000,
"quoteMaxToken": 120000,
"maxTemperature": 1.2,
"charsPointsPrice": 0,
"censor": false,
"vision": false,
"datasetProcess": true,
"usedInClassify": true,
"usedInExtractFields": true,
"usedInToolCall": true,
"toolChoice": false,
"functionCall": false,
"defaultSystemChatPrompt": "",
"defaultConfig": {
"temperature": 1,
"max_tokens": null,
"stream": false
}
}
],
"vectorModels": [
{
"provider": "OpenAI",
"model": "text-embedding-3-small",
"name": "text-embedding-3-small",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 3000,
"weight": 100
},
{
"provider": "OpenAI",
"model": "text-embedding-3-large",
"name": "text-embedding-3-large",
"charsPointsPrice": 0,
"defaultToken": 512,
"maxToken": 3000,
"weight": 100,
"defaultConfig": {
"dimensions": 1024
}
},
{
"provider": "OpenAI",
"model": "text-embedding-ada-002", // 模型名(与OneAPI对应)
"name": "Embedding-2", // 模型展示名
"charsPointsPrice": 0, // n积分/1k token
"defaultToken": 700, // 默认文本分割时候的 token
"maxToken": 3000, // 最大 token
"weight": 100, // 优先训练权重
"defaultConfig": {}, // 自定义额外参数。例如,如果希望使用 embedding3-large 的话,可以传入 dimensions:1024,来返回1024维度的向量。(目前必须小于1536维度)
"dbConfig": {}, // 存储时的额外参数(非对称向量模型时候需要用到)
"queryConfig": {} // 参训时的额外参数
}
],
"reRankModels": [],
"audioSpeechModels": [
{
"provider": "OpenAI",
"model": "tts-1",
"name": "OpenAI TTS1",
"charsPointsPrice": 0,
"voices": [
{ "label": "Alloy", "value": "alloy", "bufferId": "openai-Alloy" },
{ "label": "Echo", "value": "echo", "bufferId": "openai-Echo" },
{ "label": "Fable", "value": "fable", "bufferId": "openai-Fable" },
{ "label": "Onyx", "value": "onyx", "bufferId": "openai-Onyx" },
{ "label": "Nova", "value": "nova", "bufferId": "openai-Nova" },
{ "label": "Shimmer", "value": "shimmer", "bufferId": "openai-Shimmer" }
]
}
],
"whisperModel": {
"provider": "OpenAI",
"model": "whisper-1",
"name": "Whisper1",
"charsPointsPrice": 0
}
}
......@@ -11,8 +11,8 @@
"build:workers:watch": "npx tsx scripts/build-workers.ts --watch"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@chakra-ui/anatomy": "catalog:",
......
......@@ -9,8 +9,8 @@
"lint": "next lint"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@chakra-ui/anatomy": "catalog:",
......
......@@ -14,8 +14,8 @@
"mcp_test": "npx @modelcontextprotocol/inspector"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"@fastgpt/global": "workspace:*",
......
......@@ -12,8 +12,8 @@
"test:watch": "vitest"
},
"engines": {
"node": "20.x",
"pnpm": "9.x"
"node": ">=20.x",
"pnpm": ">=9.x"
},
"dependencies": {
"axios": "^1.7.9",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment