Skip to content

Commit 8d4d5af

Browse files
author
poulphunter
committed
presets always on, you can create, load, saves presets
code refactor, easier to maintain
1 parent b4d7303 commit 8d4d5af

File tree

8 files changed

+528
-359
lines changed

8 files changed

+528
-359
lines changed

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,37 @@ trying to be more accessible for non-it people, more intuitive and easier to mai
77

88
**Features:**
99

10-
- Mobile, medium devices and desktop UI/UX
1110
- Localisations (Chinese, Dutch, English, French, Italian, Spanish, Russian)
12-
- Conversation list
13-
- save / edit / conversations
14-
- Settings tag
15-
- Presets
16-
- automatic if config file embed in server
17-
- load file (save embed file)
18-
- multilingual
11+
- Conversations
12+
- save / load / delete all conversations, your work
13+
- Settings tab
14+
- with Presets (multilingual)
15+
- save / load / delete presets
1916
- Ideas of questions (loaded with presets)
17+
- Mobile, medium devices and desktop UI/UX
18+
- HTML code preview
19+
- SVG image preview
20+
- Markdown / Math render (from legacy project)
21+
- Languages code highlight (from legacy project)
2022
- [Experimental] Python interpreter (from legacy project)
2123

2224
![Mobile Python Example Ask 1](doc/mobile_python_example_ask1.png 'Mobile Python Example Ask 1')
2325

2426
## Prompt master
2527

26-
To quickly make a change in your settings you can go to the Settings tab.
27-
To make change effective, click the save button in bottom right corner.
28+
To quickly make a change in your settings you can go to the Settings tab.
29+
You can easily change the System message, the main option are just down there like temperature, top_k, top_p, etc...
30+
31+
To save your preset, click on the save button on the bottom-right corner.
32+
If you want to use many presets, you can enter a name in the "preset" input on the top of the settings tab.
33+
Before closing your browser, you can save all your changes and load them next time.
2834

29-
### Json presets
35+
### Json presets format
3036

31-
If you want to configure some presets, use the json configuration file.
37+
If you want to manually set some presets, use the json configuration file.
3238
If you leave language empty, it will show in all languages.
3339
When loading, the first preset of the list in your language will be used.
34-
When you change language, presets will be reloaded using the new language.
40+
When you change language, presets will be reloaded using the new language if the preset input is empty.
3541

3642
Here a full example of json presets :
3743

src/Config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const BASE_URL =
1212
new URL(window.location.href).searchParams.get('h') ??
1313
new URL('.', document.baseURI).href.toString().replace(/\/$/, '');
1414

15+
export type CONFIG_DEFAULT_KEY = string | boolean | number | string[];
1516
export const CONFIG_DEFAULT = {
1617
// Note: in order not to introduce breaking changes, please keep the same data type (number, string, etc.) if you want to change the default value. Do not use null or undefined for default value.
1718
// Do not use nested objects, keep it single level. Prefix the key if you need to group them.
@@ -45,6 +46,13 @@ export const CONFIG_DEFAULT = {
4546
pyIntepreterEnabled: false,
4647
questionIdeas: [''],
4748
};
49+
export const PROMPT_JSON = [
50+
{
51+
name: '',
52+
lang: '',
53+
config: CONFIG_DEFAULT,
54+
},
55+
];
4856
// list of themes supported by daisyui
4957
export const THEMES = ['light', 'dark']
5058
// make sure light & dark are always at the beginning

0 commit comments

Comments
 (0)