+ Experimental features are not guaranteed to work correctly.
+
+
+ If you encounter any problems, create a{' '}
+
+ Bug (misc.)
+ {' '}
+ report on Github. Please also specify webui/experimental on
+ the report title and include screenshots.
+
+
+ Some features may require packages downloaded from CDN, so they
+ need internet connection.
+
+ >
+ ),
+ },
+ {
+ type: SettingInputType.CHECKBOX,
+ label: (
+ <>
+ Enable Python interpreter
+
+
+ This feature uses{' '}
+ pyodide,
+ downloaded from CDN. To use this feature, ask the LLM to generate
+ python code inside a markdown code block. You will see a "Run"
+ button on the code block, near the "Copy" button.
+
+ >
+ ),
+ key: 'pyIntepreterEnabled',
+ },
+ ],
+ },
+];
+
export default function SettingDialog({
show,
onClose,
@@ -40,6 +266,7 @@ export default function SettingDialog({
onClose: () => void;
}) {
const { config, saveConfig } = useAppContext();
+ const [sectionIdx, setSectionIdx] = useState(0);
// clone the config object to prevent direct mutation
const [localConfig, setLocalConfig] = useState(
@@ -92,181 +319,109 @@ export default function SettingDialog({
onClose();
};
- const debugImportDemoConv = async () => {
- const res = await fetch('/demo-conversation.json');
- const demoConv = await res.json();
- StorageUtils.remove(demoConv.id);
- for (const msg of demoConv.messages) {
- StorageUtils.appendMsg(demoConv.id, msg);
- }
- onClose();
- };
-
const onChange = (key: SettKey) => (value: string | boolean) => {
// note: we do not perform validation here, because we may get incomplete value as user is still typing it
setLocalConfig({ ...localConfig, [key]: value });
};
return (
-