Skip to content

Commit 6004387

Browse files
authored
Merge pull request #31 from devchat-ai/feat/config
Feat/config
2 parents 96f6f79 + d195e0a commit 6004387

19 files changed

Lines changed: 900 additions & 332 deletions

File tree

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
"@emotion/react": "^11.10.8",
113113
"@mantine/core": "^6.0.10",
114114
"@mantine/dropzone": "^6.0.10",
115+
"@mantine/form": "^7.5.3",
115116
"@mantine/hooks": "^6.0.10",
116117
"@mantine/prism": "^6.0.10",
117118
"@mantine/tiptap": "^6.0.10",
@@ -126,6 +127,8 @@
126127
"dotenv": "^16.0.3",
127128
"i18next": "^23.7.11",
128129
"js-yaml": "^4.1.0",
130+
"lodash.clonedeep": "^4.5.0",
131+
"lodash.isequal": "^4.5.0",
129132
"mdast": "^3.0.0",
130133
"mdast-util-from-markdown": "^2.0.0",
131134
"mdast-util-to-markdown": "^2.1.0",

src/index.tsx

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
1-
import * as React from 'react';
2-
import { createRoot } from 'react-dom/client';
3-
import { MantineProvider, MantineThemeOverride } from '@mantine/core';
4-
import { Provider, rootStore } from '@/views/stores/RootStore';
5-
import App from '@/views/App';
1+
import * as React from "react";
2+
import { createRoot } from "react-dom/client";
3+
import { MantineProvider, MantineThemeOverride } from "@mantine/core";
4+
import { Provider, rootStore } from "@/views/stores/RootStore";
5+
import App from "@/views/App";
66

7-
const container = document.getElementById('app')!;
7+
const container = document.getElementById("app")!;
88
const root = createRoot(container); // createRoot(container!) if you use TypeScript
99
const myTheme: MantineThemeOverride = {
10-
fontFamily: 'var(--vscode-editor-font-family)',
11-
colors: {
12-
"merico":[
13-
"#F9F5F4",
14-
"#EADAD6",
15-
"#E1C0B6",
16-
"#DEA594",
17-
"#E1886F",
18-
"#ED6A45",
19-
"#D75E3C",
20-
"#BD573B",
21-
"#9F5541",
22-
"#865143",
23-
],
24-
},
25-
primaryColor: 'merico',
26-
components: {
27-
Text: {
28-
styles: {
29-
root:{
30-
fontSize: 'var(--vscode-editor-font-size)',
31-
}
32-
}
10+
fontFamily: "var(--vscode-editor-font-family)",
11+
colors: {
12+
merico: [
13+
"#F9F5F4",
14+
"#EADAD6",
15+
"#E1C0B6",
16+
"#DEA594",
17+
"#E1886F",
18+
"#ED6A45",
19+
"#D75E3C",
20+
"#BD573B",
21+
"#9F5541",
22+
"#865143",
23+
],
24+
},
25+
primaryColor: "merico",
26+
components: {
27+
Text: {
28+
styles: {
29+
root: {
30+
fontSize: "var(--vscode-editor-font-size)",
3331
},
3432
},
33+
},
34+
},
3535
};
36-
3736

3837
root.render(
39-
<MantineProvider withGlobalStyles withNormalizeCSS withCSSVariables
40-
theme={myTheme}>
41-
<Provider value={rootStore}>
42-
<App />
43-
</Provider>
44-
</MantineProvider>
38+
<MantineProvider
39+
withGlobalStyles
40+
withNormalizeCSS
41+
withCSSVariables
42+
theme={myTheme}
43+
>
44+
<Provider value={rootStore}>
45+
<App />
46+
</Provider>
47+
</MantineProvider>
4548
);

src/models/index.ts

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
const modelsTemplate = [
2+
{
3+
name: "gpt-3.5-turbo",
4+
provider: "devchat",
5+
stream: true,
6+
max_input_tokens: 13000,
7+
// temperature: 0.3,
8+
// max_tokens: 2048,
9+
},
10+
{
11+
name: "gpt-4",
12+
provider: "devchat",
13+
stream: true,
14+
max_input_tokens: 6000,
15+
// temperature: 0.3,
16+
// max_tokens: 2048,
17+
},
18+
{
19+
name: "gpt-4-turbo-preview",
20+
provider: "devchat",
21+
stream: true,
22+
max_input_tokens: 32000,
23+
// temperature: 0.3,
24+
// max_tokens: 2048,
25+
},
26+
{
27+
name: "claude-2.1",
28+
provider: "devchat",
29+
stream: true,
30+
max_input_tokens: 32000,
31+
// temperature: 0.3,
32+
// max_tokens: 2048,
33+
},
34+
{
35+
name: "xinghuo-3.5",
36+
provider: "devchat",
37+
stream: true,
38+
max_input_tokens: 6000,
39+
// temperature: 0.3,
40+
// max_tokens: 2048,
41+
},
42+
{
43+
name: "GLM-4",
44+
provider: "devchat",
45+
stream: true,
46+
max_input_tokens: 8000,
47+
// temperature: 0.3,
48+
// max_tokens: 2048,
49+
},
50+
{
51+
name: "ERNIE-Bot-4.0",
52+
provider: "devchat",
53+
stream: true,
54+
max_input_tokens: 8000,
55+
// temperature: 0.3,
56+
// max_tokens: 2048,
57+
},
58+
{
59+
name: "togetherai/codellama/CodeLlama-70b-Instruct-hf",
60+
provider: "devchat",
61+
stream: true,
62+
max_input_tokens: 4000,
63+
// temperature: 0.3,
64+
// max_tokens: 2048,
65+
},
66+
{
67+
name: "togetherai/mistralai/Mixtral-8x7B-Instruct-v0.1",
68+
provider: "devchat",
69+
stream: true,
70+
// max_input_tokens: 4000,
71+
// temperature: 0.3,
72+
// max_tokens: 2048,
73+
},
74+
{
75+
name: "minimax/abab6-chat",
76+
provider: "devchat",
77+
stream: true,
78+
// max_input_tokens: 4000,
79+
// temperature: 0.3,
80+
// max_tokens: 2048,
81+
},
82+
{
83+
name: "llama-2-70b-chat",
84+
provider: "devchat",
85+
stream: true,
86+
// max_input_tokens: 4000,
87+
// temperature: 0.3,
88+
// max_tokens: 2048,
89+
},
90+
];
91+
92+
export default modelsTemplate;

src/util/getModelShowName.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const nameMap = {
2+
"gpt-3.5-turbo": "GPT-3.5",
3+
"gpt-4": "GPT-4",
4+
"gpt-4-turbo-preview": "GPT-4-turbo",
5+
"claude-2.1": "CLAUDE-2.1",
6+
"xinghuo-3.5": "xinghuo-3.5",
7+
"GLM-4": "GLM-4",
8+
"ERNIE-Bot-4.0": "ERNIE-Bot-4.0",
9+
"togetherai/codellama/CodeLlama-70b-Instruct-hf": "CodeLlama-70b",
10+
"togetherai/mistralai/Mixtral-8x7B-Instruct-v0.1": "Mixtral-8x7B",
11+
"minimax/abab6-chat": "minimax-abab6",
12+
"llama-2-70b-chat": "llama2-70b",
13+
};
14+
15+
export default function getModelShowName(modelName: string) {
16+
if (modelName in nameMap) {
17+
return nameMap[modelName];
18+
} else if (modelName.lastIndexOf("/") > -1) {
19+
return modelName
20+
.substring(modelName.lastIndexOf("/") + 1)
21+
.toLocaleUpperCase();
22+
} else {
23+
return modelName.toUpperCase();
24+
}
25+
}

0 commit comments

Comments
 (0)