forked from lobehub/lobe-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sparkles: feat: Chat v0.1 (lobehub#7)
--------- Co-authored-by: canisminor1990 <i@canisminor.cc>
- Loading branch information
1 parent
59d381e
commit 3db700a
Showing
83 changed files
with
3,460 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
const config = require('@umijs/lint/dist/config/eslint'); | ||
const config = require('@lobehub/lint').eslint; | ||
|
||
config.extends.push('plugin:@next/next/recommended'); | ||
//config.extends.push('plugin:@next/next/core-web-vitals'); | ||
|
||
module.exports = { | ||
...config, | ||
extends: ['plugin:@next/next/recommended'], | ||
rules: { | ||
...config.rules, | ||
'react/jsx-sort-props': 'off', | ||
'sort-keys-fix/sort-keys-fix': 'off', | ||
'typescript-sort-keys/interface': 'off', | ||
'unicorn/switch-case-braces': 'off', | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
module.exports = { | ||
printWidth: 100, | ||
printWidth: 120, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
proseWrap: 'never', | ||
endOfLine: 'lf', | ||
overrides: [{ files: '.prettierrc', options: { parser: 'json' } }], | ||
plugins: [ | ||
require.resolve('prettier-plugin-packagejson'), | ||
require.resolve('prettier-plugin-organize-imports'), | ||
], | ||
plugins: [require.resolve('prettier-plugin-packagejson'), require.resolve('prettier-plugin-organize-imports')], | ||
pluginSearchDirs: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// @ts-check | ||
const API_END_PORT_URL = process.env.API_END_PORT_URL || ''; | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
pageExtensions: ['page.tsx', 'api.ts'], | ||
transpilePackages: ['@lobehub/ui', 'antd-style'], | ||
webpack(config) { | ||
config.experiments = { | ||
asyncWebAssembly: true, | ||
layers: true, | ||
}; | ||
|
||
return config; | ||
}, | ||
|
||
async rewrites() { | ||
return [ | ||
{ | ||
source: '/api/openai-dev', | ||
destination: `${API_END_PORT_URL}/api/openai`, | ||
}, | ||
{ | ||
source: '/api/chain-dev', | ||
destination: `${API_END_PORT_URL}/api/chain`, | ||
}, | ||
]; | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const OPENAI_SERVICE_ERROR_CODE = 555; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { LanguageModel } from '@/types/llm'; | ||
|
||
export const ModelTokens: Record<LanguageModel, number> = { | ||
[LanguageModel.GPT3_5]: 4096, | ||
[LanguageModel.GPT3_5_16K]: 4096 * 4, | ||
[LanguageModel.GPT4]: 8196, | ||
[LanguageModel.GPT4_32K]: 8196 * 4, | ||
}; |
Oops, something went wrong.