Skip to content

Commit

Permalink
Added workbench UI option (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
cybermaggedon authored Dec 20, 2024
1 parent 036e6a7 commit a54e648
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 17 deletions.
12 changes: 11 additions & 1 deletion src/simple-editor/generate-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ModelParams } from './state/ModelParams';
import { Prompts } from './state/Prompts';
import { Agents } from './state/Agents';
import {
Options, CONFIGURE_PROMPTS, CONFIGURE_AGENTS
Options, CONFIGURE_PROMPTS, CONFIGURE_AGENTS, CONFIGURE_WORKBENCH,
} from './state/Options';

export const generateConfig =
Expand Down Expand Up @@ -98,6 +98,16 @@ export const generateConfig =

}

if (options.options.has(CONFIGURE_WORKBENCH)) {

config.push({
"name": "workbench-ui",
"parameters": {
},
});

}

config.push({
"name": "null",
"parameters": parameters,
Expand Down
13 changes: 8 additions & 5 deletions src/simple-editor/options/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import { Card, CardHeader, CardContent, CardActionArea } from '@mui/material';
import { Typography } from '@mui/material';
import { blue } from '@mui/material/colors';

const Option = ({enabled, onChange, avatar, title, content} : {
interface OptionProps extends React.PropsWithChildren {
enabled : boolean;
onChange : () => void,
avatar : React.ReactNode;
title : string;
content : React.ReactNode;
}) => {
children : React.ReactNode;
};

const Option : React.FC<OptionProps> =
({enabled, onChange, avatar, title, children}) => {

const Header = () => {

Expand Down Expand Up @@ -56,7 +59,7 @@ const Option = ({enabled, onChange, avatar, title, content} : {
<Typography
variant="body2"
>
{content}
{children}
</Typography>
</CardContent>
);
Expand All @@ -66,7 +69,7 @@ const Option = ({enabled, onChange, avatar, title, content} : {
<Typography
variant="body2"
>
{content}
{children}
</Typography>
</CardContent>
);
Expand Down
36 changes: 25 additions & 11 deletions src/simple-editor/options/Options.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@


import { Stack } from '@mui/material';
import { Psychology, ChatBubble } from '@mui/icons-material';
import { Psychology, ChatBubble, Insights } from '@mui/icons-material';
import { useDeploymentStore } from '../state/Deployment';

import {
useOptionsStore, CONFIGURE_PROMPTS, CONFIGURE_AGENTS
useOptionsStore, CONFIGURE_PROMPTS, CONFIGURE_AGENTS,
CONFIGURE_WORKBENCH,
} from '../state/Options';

import Option from './Option';
Expand All @@ -26,6 +27,7 @@ const ParamsForm: React.FC = ({

const configurePrompts = options.has(CONFIGURE_PROMPTS);
const configureAgents = options.has(CONFIGURE_AGENTS);
const configureWorkbench = options.has(CONFIGURE_WORKBENCH);

const set = (o : string, value : boolean) => {
if (value) {
Expand All @@ -47,6 +49,10 @@ const ParamsForm: React.FC = ({
set(CONFIGURE_AGENTS, !configureAgents);
};

const onConfigureWorkbench = () => {
set(CONFIGURE_WORKBENCH, !configureWorkbench);
};

return (
<>

Expand All @@ -59,22 +65,30 @@ const ParamsForm: React.FC = ({
onChange={onConfigurePrompts}
avatar={<ChatBubble color="primary"/>}
title="Data Extraction Prompts"
content={
'Tailor the LLM system prompts, data extraction prompts, and RAG query prompts.'
}

/>
>
Tailor the LLM system prompts, data extraction prompts,
and RAG query prompts.
</Option>

<Option
enabled={configureAgents}
onChange={onConfigureAgents}
avatar={<Psychology color="primary"/>}
title="Agent Definitions"
content={
'Add Agents that use a ReAct approach. Customize the Agent definitions, options, and arguments.'
}
>
Add Agents that use a ReAct approach. Customize the
Agent definitions, options, and arguments.
</Option>

/>
<Option
enabled={configureWorkbench}
onChange={onConfigureWorkbench}
avatar={<Insights color="primary"/>}
title="Workbench UI"
>
An experimental UI providing some tools to interact with
data.
</Option>

</Stack>

Expand Down
2 changes: 2 additions & 0 deletions src/simple-editor/state/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export const CONFIGURE_PROMPTS = "configure-prompts";

export const CONFIGURE_AGENTS = "configure-agents";

export const CONFIGURE_WORKBENCH = "configure-workbench";

export interface Options {

options : Set<string>;
Expand Down

0 comments on commit a54e648

Please sign in to comment.