Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/lobehub/lobe-chat
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 19, 2024
2 parents bc50e47 + 2134451 commit 502c5ae
Show file tree
Hide file tree
Showing 47 changed files with 1,428 additions and 243 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ next-env.d.ts
.next
.env
public/*.js
public/sitemap.xml
public/sitemap-index.xml
bun.lockb
sitemap*.xml
robots.txt
Expand Down
101 changes: 101 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,107 @@

# Changelog

### [Version 1.19.7](https://github.com/lobehub/lobe-chat/compare/v1.19.6...v1.19.7)

<sup>Released on **2024-09-19**</sup>

#### 💄 Styles

- **misc**: Add siliconflow qwen2.5 model.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

- **misc**: Add siliconflow qwen2.5 model, closes [#4024](https://github.com/lobehub/lobe-chat/issues/4024) ([06ffd99](https://github.com/lobehub/lobe-chat/commit/06ffd99))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.6](https://github.com/lobehub/lobe-chat/compare/v1.19.5...v1.19.6)

<sup>Released on **2024-09-19**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the tts route url.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

- **misc**: Refactor the tts route url, closes [#4030](https://github.com/lobehub/lobe-chat/issues/4030) ([60dcf19](https://github.com/lobehub/lobe-chat/commit/60dcf19))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.5](https://github.com/lobehub/lobe-chat/compare/v1.19.4...v1.19.5)

<sup>Released on **2024-09-19**</sup>

#### 💄 Styles

- **misc**: Enable functioncall for stepfun models, Update qwen models.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

- **misc**: Enable functioncall for stepfun models, closes [#4022](https://github.com/lobehub/lobe-chat/issues/4022) ([afb3509](https://github.com/lobehub/lobe-chat/commit/afb3509))
- **misc**: Update qwen models, closes [#4026](https://github.com/lobehub/lobe-chat/issues/4026) ([6169e8f](https://github.com/lobehub/lobe-chat/commit/6169e8f))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.4](https://github.com/lobehub/lobe-chat/compare/v1.19.3...v1.19.4)

<sup>Released on **2024-09-19**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor the sitemap implement.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

- **misc**: Refactor the sitemap implement, closes [#4012](https://github.com/lobehub/lobe-chat/issues/4012) ([d93a161](https://github.com/lobehub/lobe-chat/commit/d93a161))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>

### [Version 1.19.3](https://github.com/lobehub/lobe-chat/compare/v1.19.2...v1.19.3)

<sup>Released on **2024-09-19**</sup>
Expand Down
53 changes: 0 additions & 53 deletions next-sitemap.config.mjs

This file was deleted.

10 changes: 10 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ const nextConfig = {
output: buildWithDocker ? 'standalone' : undefined,
reactStrictMode: true,
redirects: async () => [
{
destination: '/sitemap-index.xml',
permanent: true,
source: '/sitemap.xml',
},
{
destination: '/discover',
permanent: true,
source: '/market',
},
{
destination: '/settings/common',
permanent: true,
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lobehub/chat",
"version": "1.19.3",
"version": "1.19.7",
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",
Expand Down Expand Up @@ -29,11 +29,11 @@
"build": "next build",
"postbuild": "npm run build-sitemap && npm run build-migrate-db",
"build-migrate-db": "bun run db:migrate",
"build-sitemap": "next-sitemap --config next-sitemap.config.mjs",
"build-sitemap": "tsx ./scripts/buildSitemapIndex/index.ts",
"build:analyze": "ANALYZE=true next build",
"build:docker": "DOCKER=true next build && npm run build-sitemap",
"db:generate": "drizzle-kit generate",
"db:migrate": "MIGRATION_DB=1 tsx scripts/migrateServerDB/index.ts",
"db:migrate": "MIGRATION_DB=1 tsx ./scripts/migrateServerDB/index.ts",
"db:push": "drizzle-kit push",
"db:push-test": "NODE_ENV=test drizzle-kit push",
"db:studio": "drizzle-kit studio",
Expand Down Expand Up @@ -65,11 +65,11 @@
"test:update": "vitest -u",
"type-check": "tsc --noEmit",
"webhook:ngrok": "ngrok http http://localhost:3011",
"workflow:docs": "tsx scripts/docsWorkflow/index.ts",
"workflow:i18n": "tsx scripts/i18nWorkflow/index.ts",
"workflow:docs": "tsx ./scripts/docsWorkflow/index.ts",
"workflow:i18n": "tsx ./scripts/i18nWorkflow/index.ts",
"workflow:mdx": "tsx ./scripts/mdxWorkflow/index.ts",
"workflow:mdx-with-lint": "tsx ./scripts/mdxWorkflow/index.ts && eslint \"docs/**/*.mdx\" --quiet --fix",
"workflow:readme": "tsx scripts/readmeWorkflow/index.ts"
"workflow:readme": "tsx ./scripts/readmeWorkflow/index.ts"
},
"lint-staged": {
"*.md": [
Expand Down Expand Up @@ -172,7 +172,6 @@
"next": "14.2.8",
"next-auth": "beta",
"next-mdx-remote": "^4.4.1",
"next-sitemap": "^4.2.3",
"nextjs-toploader": "^3.6.15",
"numeral": "^2.0.6",
"nuqs": "^1.17.8",
Expand Down
12 changes: 12 additions & 0 deletions scripts/buildSitemapIndex/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { writeFileSync } from 'node:fs';
import { resolve } from 'node:path';

import { sitemapModule } from '@/server/sitemap';

const genSitemap = () => {
const sitemapIndexXML = sitemapModule.getIndex();
const filename = resolve(__dirname, '../../', 'public', 'sitemap-index.xml');
writeFileSync(filename, sitemapIndexXML);
};

genSitemap();
1 change: 1 addition & 0 deletions src/app/(main)/discover/(detail)/assistant/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const Page = async ({ params, searchParams }: Props) => {
/>
}
/* ↓ cloud slot ↓ */

/* ↑ cloud slot ↑ */
>
<Temp data={data} identifier={identifier} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const ProviderItem = memo<ProviderItemProps>(({ mobile, modelId, identifier }) =
: '--',
},
/* ↓ cloud slot ↓ */

/* ↑ cloud slot ↑ */
];

Expand Down
1 change: 1 addition & 0 deletions src/app/(main)/discover/(detail)/model/[...slugs]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const Page = async ({ params, searchParams }: Props) => {
mobile={mobile}
sidebar={<InfoSidebar data={data} identifier={identifier} mobile={mobile} />}
/* ↓ cloud slot ↓ */

/* ↑ cloud slot ↑ */
>
<ProviderList data={providerData} identifier={identifier} mobile={mobile} />
Expand Down
1 change: 1 addition & 0 deletions src/app/(main)/discover/(detail)/plugin/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const Page = async ({ params, searchParams }: Props) => {
mobile={mobile}
sidebar={<InfoSidebar data={data} identifier={identifier} mobile={mobile} />}
/* ↓ cloud slot ↓ */

/* ↑ cloud slot ↑ */
>
<ParameterList data={data} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const ModelItem = memo<SuggestionItemProps>(({ mobile, meta, identifier }) => {
: '--',
},
/* ↓ cloud slot ↓ */

/* ↑ cloud slot ↑ */
];

Expand Down
1 change: 1 addition & 0 deletions src/app/(main)/discover/(detail)/provider/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const Page = async ({ params, searchParams }: Props) => {
mobile={mobile}
sidebar={<InfoSidebar data={data} identifier={identifier} />}
/* ↓ cloud slot ↓ */

/* ↑ cloud slot ↑ */
>
<ModelList identifier={identifier} mobile={mobile} modelData={modelData} />
Expand Down
1 change: 1 addition & 0 deletions src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const Nav = memo(() => {
{!isHome && !isProviders && (
<Flexbox align={'center'} gap={4} horizontal>
{/* ↓ cloud slot ↓ */}

{/* ↑ cloud slot ↑ */}
</Flexbox>
)}
Expand Down
1 change: 1 addition & 0 deletions src/app/(main)/discover/_layout/Desktop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const Layout = ({ children }: PropsWithChildren) => {
{children}
</Flexbox>
{/* ↓ cloud slot ↓ */}

{/* ↑ cloud slot ↑ */}
</>
);
Expand Down
1 change: 1 addition & 0 deletions src/app/api/openai/createBizOpenAI/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { checkAuth } from './auth';
import { createOpenai } from './createOpenai';

/**
* @deprecated
* createOpenAI Instance with Auth and azure openai support
* if auth not pass ,just return error response
*/
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Metadata } from 'next';

import { getCanonicalUrl } from '@/const/url';
import { getCanonicalUrl } from '@/server/utils/url';

import Client from './(loading)/Client';
import Redirect from './(loading)/Redirect';
Expand Down
16 changes: 16 additions & 0 deletions src/app/robots.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { MetadataRoute } from 'next';

import { sitemapModule } from '@/server/sitemap';
import { getCanonicalUrl } from '@/server/utils/url';

export default function robots(): MetadataRoute.Robots {
return {
host: getCanonicalUrl(),
rules: {
allow: ['/'],
disallow: ['/api/*'],
userAgent: '*',
},
sitemap: sitemapModule.getRobots(),
};
}
30 changes: 30 additions & 0 deletions src/app/sitemap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { MetadataRoute } from 'next';

import { SitemapType, sitemapModule } from '@/server/sitemap';

export const generateSitemaps = async () => {
// Fetch the total number of products and calculate the number of sitemaps needed
return sitemapModule.sitemapIndexs;
};

const Sitemap = async ({ id }: { id: SitemapType }): Promise<MetadataRoute.Sitemap> => {
switch (id) {
case SitemapType.Pages: {
return sitemapModule.getPage();
}
case SitemapType.Assistants: {
return sitemapModule.getAssistants();
}
case SitemapType.Plugins: {
return sitemapModule.getPlugins();
}
case SitemapType.Models: {
return sitemapModule.getModels();
}
case SitemapType.Providers: {
return sitemapModule.getProviders();
}
}
};

export default Sitemap;
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const preferredRegion = [
export const POST = async (req: Request) => {
const payload = (await req.json()) as OpenAITTSPayload;

// need to be refactored with jwt auth mode
const openaiOrErrResponse = createBizOpenAI(req);

// if resOrOpenAI is a Response, it means there is an error,just return it
Expand Down
Loading

0 comments on commit 502c5ae

Please sign in to comment.