Skip to content

Commit a8d8c5c

Browse files
authored
Merge pull request #306 from thedadams/nice-dynamic-instructions-name
enhance: change dynamic instructions name to Dynamic Instructions
2 parents 8bc816e + 5ddb48f commit a8d8c5c

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

components/scripts/tool-dropdown.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,19 @@ const ScriptToolsDropdown = () => {
4343
setThreadTools(threadTools);
4444
}, [tools, displayNames, knowledgeGatewayTool]);
4545

46+
function dynamicInstructions(name: string | undefined): string | undefined {
47+
if (name && name === 'dynamic-instructions') {
48+
return 'Dynamic Instructions';
49+
}
50+
51+
return name;
52+
}
53+
4654
function getDisplayName(ref: string): string {
55+
if (ref === 'dynamic-instructions') {
56+
return 'Dynamic Instructions';
57+
}
58+
4759
return (
4860
ref
4961
.split('/')
@@ -100,9 +112,11 @@ const ScriptToolsDropdown = () => {
100112
content={t}
101113
isReadOnly
102114
>
103-
{program.toolSet[
104-
(v.find((v) => v.reference === t) || {}).toolID || ''
105-
].name || getDisplayName(t)}
115+
{dynamicInstructions(
116+
program.toolSet[
117+
(v.find((v) => v.reference === t) || {}).toolID || ''
118+
].name
119+
) || getDisplayName(t)}
106120
</DropdownItem>
107121
))
108122
) : (

0 commit comments

Comments
 (0)