Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting adjustments to Agent Tools #54

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/simple-editor/agents/ConfigureAgents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ConfigureAgents = ({
<Box>

<Typography variant="h5" component="h2" gutterBottom>
Configure Agents
Configure Tools
</Typography>

<AgentControls
Expand Down
61 changes: 36 additions & 25 deletions src/simple-editor/agents/ToolEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,22 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
<Grid container spacing={2}>

<Grid size={12}>
<Divider textAlign="left">
Tool Definition
</Divider>
<Divider
sx={{
borderBottom: '2px solid #3064C8',
}}/>
</Grid>

<Grid size={12}>
<Divider textAlign="left">Definition</Divider>
</Grid>

<Grid size={{ xs: 12, md: 4 }}>
<TextField
fullWidth
label="TrustGraph ID"
value={tool.id}
multiline
label="ID"
placeholder={tool.id}
onChange={
(event: React.ChangeEvent<HTMLInputElement>) => {
setId(event.target.value);
Expand All @@ -156,8 +162,9 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
<Grid size={{ xs: 12, md: 8 }}>
<TextField
fullWidth
label="Tool Name"
value={tool.name}
multiline
label="Name"
placeholder={tool.name}
onChange={
(event: React.ChangeEvent<HTMLInputElement>) => {
setName(event.target.value);
Expand All @@ -169,13 +176,13 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
<Grid size={12}>
<FormControl fullWidth>

<InputLabel id="type-label">Tool Options</InputLabel>
<InputLabel id="type-label">Options</InputLabel>

<Select
labelId="type-label"
id="type-select"
value={tool.type}
label="Tool Options"
label="Options"
onChange={(e) => setType(e.target.value)}
sx={{minHeight: '6rem'}}
>
Expand Down Expand Up @@ -253,9 +260,9 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
<Grid size={12}>
<TextField
fullWidth
label="Tool Instructions"
label="Instructions"
multiline
value={tool.description}
placeholder={tool.description}
rows={5}
onChange={
(event: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -271,17 +278,25 @@ const ToolEditor : React.FC<ToolEditorProps> = ({

<React.Fragment key={ix}>

<Grid size={12}>
<Divider
sx={{
borderBottom: '2px solid #3064C8',
}}/>
</Grid>

<Grid size={12}>
<Divider textAlign="left">
{'Tool Argument ' + (ix+1) + ': ' + arg.name}
{'Argument ' + (ix+1) + ': ' + arg.name}
</Divider>
</Grid>

<Grid size={4}>
<TextField
fullWidth
label="Argument Name"
value={arg.name}
multiline
label="Name"
placeholder={arg.name}
onChange={
(event: React.ChangeEvent<HTMLInputElement>) => {
setArgName(
Expand All @@ -297,16 +312,12 @@ const ToolEditor : React.FC<ToolEditorProps> = ({

<FormControl fullWidth>

<InputLabel
id={ 'arg-type-' + ix }
>
Argument Type
</InputLabel>
<InputLabel id={ 'arg-type-' + ix }>Type</InputLabel>

<Select
labelId = { 'arg-type-' + ix }
value={arg.type}
label="Argument Type"
label="Type"
onChange={
(e) =>
setArgType(
Expand Down Expand Up @@ -338,7 +349,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
variant="contained"
onClick={ () => deleteArg(ix) }
>
Delete {arg.name}
Delete
</Button>
</Box>

Expand All @@ -349,8 +360,8 @@ const ToolEditor : React.FC<ToolEditorProps> = ({

<TextField
fullWidth
label="Argument Definition"
value={arg.description}
label="Description"
placeholder={arg.description}
multiline
rows={2}
onChange={
Expand Down Expand Up @@ -380,7 +391,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
variant="contained"
onClick={ addArgument }
>
Add Tool Argument
Add Argument
</Button>
}

Expand All @@ -394,7 +405,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
variant="contained"
onClick={ deleteTool }
>
Delete {tool.name}
Delete Tool
</Button>
}

Expand Down