Skip to content

Commit a3a1bb8

Browse files
authoredNov 13, 2024··
Merge pull request #54 from trustgraph-ai/dev-tweaks
Formatting adjustments to Agent Tools

File tree

2 files changed

+37
-26
lines changed

2 files changed

+37
-26
lines changed
 

‎src/simple-editor/agents/ConfigureAgents.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const ConfigureAgents = ({
5656
<Box>
5757

5858
<Typography variant="h5" component="h2" gutterBottom>
59-
Configure Agents
59+
Configure Tools
6060
</Typography>
6161

6262
<AgentControls

‎src/simple-editor/agents/ToolEditor.tsx

+36-25
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,22 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
135135
<Grid container spacing={2}>
136136

137137
<Grid size={12}>
138-
<Divider textAlign="left">
139-
Tool Definition
140-
</Divider>
138+
<Divider
139+
sx={{
140+
borderBottom: '2px solid #3064C8',
141+
}}/>
142+
</Grid>
143+
144+
<Grid size={12}>
145+
<Divider textAlign="left">Definition</Divider>
141146
</Grid>
142147

143148
<Grid size={{ xs: 12, md: 4 }}>
144149
<TextField
145150
fullWidth
146-
label="TrustGraph ID"
147-
value={tool.id}
151+
multiline
152+
label="ID"
153+
placeholder={tool.id}
148154
onChange={
149155
(event: React.ChangeEvent<HTMLInputElement>) => {
150156
setId(event.target.value);
@@ -156,8 +162,9 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
156162
<Grid size={{ xs: 12, md: 8 }}>
157163
<TextField
158164
fullWidth
159-
label="Tool Name"
160-
value={tool.name}
165+
multiline
166+
label="Name"
167+
placeholder={tool.name}
161168
onChange={
162169
(event: React.ChangeEvent<HTMLInputElement>) => {
163170
setName(event.target.value);
@@ -169,13 +176,13 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
169176
<Grid size={12}>
170177
<FormControl fullWidth>
171178

172-
<InputLabel id="type-label">Tool Options</InputLabel>
179+
<InputLabel id="type-label">Options</InputLabel>
173180

174181
<Select
175182
labelId="type-label"
176183
id="type-select"
177184
value={tool.type}
178-
label="Tool Options"
185+
label="Options"
179186
onChange={(e) => setType(e.target.value)}
180187
sx={{minHeight: '6rem'}}
181188
>
@@ -253,9 +260,9 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
253260
<Grid size={12}>
254261
<TextField
255262
fullWidth
256-
label="Tool Instructions"
263+
label="Instructions"
257264
multiline
258-
value={tool.description}
265+
placeholder={tool.description}
259266
rows={5}
260267
onChange={
261268
(event: React.ChangeEvent<HTMLInputElement>) => {
@@ -271,17 +278,25 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
271278

272279
<React.Fragment key={ix}>
273280

281+
<Grid size={12}>
282+
<Divider
283+
sx={{
284+
borderBottom: '2px solid #3064C8',
285+
}}/>
286+
</Grid>
287+
274288
<Grid size={12}>
275289
<Divider textAlign="left">
276-
{'Tool Argument ' + (ix+1) + ': ' + arg.name}
290+
{'Argument ' + (ix+1) + ': ' + arg.name}
277291
</Divider>
278292
</Grid>
279293

280294
<Grid size={4}>
281295
<TextField
282296
fullWidth
283-
label="Argument Name"
284-
value={arg.name}
297+
multiline
298+
label="Name"
299+
placeholder={arg.name}
285300
onChange={
286301
(event: React.ChangeEvent<HTMLInputElement>) => {
287302
setArgName(
@@ -297,16 +312,12 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
297312

298313
<FormControl fullWidth>
299314

300-
<InputLabel
301-
id={ 'arg-type-' + ix }
302-
>
303-
Argument Type
304-
</InputLabel>
315+
<InputLabel id={ 'arg-type-' + ix }>Type</InputLabel>
305316

306317
<Select
307318
labelId = { 'arg-type-' + ix }
308319
value={arg.type}
309-
label="Argument Type"
320+
label="Type"
310321
onChange={
311322
(e) =>
312323
setArgType(
@@ -338,7 +349,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
338349
variant="contained"
339350
onClick={ () => deleteArg(ix) }
340351
>
341-
Delete {arg.name}
352+
Delete
342353
</Button>
343354
</Box>
344355

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

350361
<TextField
351362
fullWidth
352-
label="Argument Definition"
353-
value={arg.description}
363+
label="Description"
364+
placeholder={arg.description}
354365
multiline
355366
rows={2}
356367
onChange={
@@ -380,7 +391,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
380391
variant="contained"
381392
onClick={ addArgument }
382393
>
383-
Add Tool Argument
394+
Add Argument
384395
</Button>
385396
}
386397

@@ -394,7 +405,7 @@ const ToolEditor : React.FC<ToolEditorProps> = ({
394405
variant="contained"
395406
onClick={ deleteTool }
396407
>
397-
Delete {tool.name}
408+
Delete Tool
398409
</Button>
399410
}
400411

0 commit comments

Comments
 (0)
Please sign in to comment.