@@ -11,8 +11,11 @@ import {
1111 FunnelIcon ,
1212 HandRaisedIcon ,
1313 SquaresPlusIcon ,
14+ WrenchScrewdriverIcon ,
1415} from '@heroicons/react/24/outline' ;
1516import { OpenInNewTab } from '../utils/common' ;
17+ import { AVAILABLE_TOOLS } from '../utils/tool_calling/register_tools' ;
18+ import { AgentTool } from '../utils/tool_calling/agent_tool' ;
1619
1720type SettKey = keyof typeof CONFIG_DEFAULT ;
1821
@@ -159,6 +162,40 @@ const SETTING_SECTIONS: SettingSection[] = [
159162 } ,
160163 ] ,
161164 } ,
165+ {
166+ title : (
167+ < >
168+ < WrenchScrewdriverIcon className = { ICON_CLASSNAME } />
169+ Tool Calling
170+ </ >
171+ ) ,
172+ fields : [
173+ {
174+ type : SettingInputType . CHECKBOX ,
175+ label : 'Enable response streaming' ,
176+ key : 'streamResponse' ,
177+ } ,
178+ // Fields will be dynamically generated based on AVAILABLE_TOOLS
179+ ...Array . from ( AVAILABLE_TOOLS . values ( ) ) . map (
180+ ( tool : AgentTool ) =>
181+ ( {
182+ type : SettingInputType . CHECKBOX ,
183+ label : (
184+ < >
185+ < span className = "font-semibold" > { tool . name || tool . id } </ span >
186+ { tool . toolDescription && (
187+ < small className = "text-xs block mt-1 opacity-70" >
188+ < strong > Agent tool description: </ strong >
189+ { tool . toolDescription }
190+ </ small >
191+ ) }
192+ </ >
193+ ) ,
194+ key : `tool_${ tool . id } _enabled` as SettKey ,
195+ } ) as SettingFieldInput
196+ ) ,
197+ ] ,
198+ } ,
162199 {
163200 title : (
164201 < >
@@ -254,21 +291,6 @@ const SETTING_SECTIONS: SettingSection[] = [
254291 ) ,
255292 key : 'pyIntepreterEnabled' ,
256293 } ,
257- {
258- type : SettingInputType . CHECKBOX ,
259- label : (
260- < >
261- < b > Enable JavaScript tool use</ b >
262- < br />
263- < small className = "text-xs" >
264- This alows LLM to use browser your browser console as tool. If
265- model supports function calling, it can use the console to do e.g.
266- data analysis etc. by itself.
267- </ small >
268- </ >
269- ) ,
270- key : 'jsInterpreterToolUse' ,
271- } ,
272294 ] ,
273295 } ,
274296] ;
0 commit comments