File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,18 +46,22 @@ export const ChatScreenLLMToolCalling = () => {
4646 modelSource : HAMMER2_1_1_5B ,
4747 tokenizerSource : HAMMER2_1_TOKENIZER ,
4848 tokenizerConfigSource : HAMMER2_1_TOKENIZER_CONFIG ,
49+ toolsConfig : {
50+ tools : TOOL_DEFINITIONS_PHONE ,
51+ // we don't implement any tool execution here
52+ // we just want to showcase model's ability
53+ executeToolCallback : async ( ) => {
54+ return null ;
55+ } ,
56+ // just for demo purpose
57+ displayToolCalls : true ,
58+ } ,
4959 } ) ;
5060
51- return < ChatScreen llm = { llm } tools = { true } /> ;
61+ return < ChatScreen llm = { llm } /> ;
5262} ;
5363
54- export default function ChatScreen ( {
55- llm,
56- tools,
57- } : {
58- llm : LLMType ;
59- tools ?: boolean ;
60- } ) {
64+ export default function ChatScreen ( { llm } : { llm : LLMType } ) {
6165 const [ isTextInputFocused , setIsTextInputFocused ] = useState ( false ) ;
6266 const [ userInput , setUserInput ] = useState ( '' ) ;
6367
@@ -73,10 +77,7 @@ export default function ChatScreen({
7377 setUserInput ( '' ) ;
7478 textInputRef . current ?. clear ( ) ;
7579 try {
76- await llm . sendMessage (
77- userInput ,
78- tools ? TOOL_DEFINITIONS_PHONE : undefined
79- ) ;
80+ await llm . sendMessage ( userInput ) ;
8081 } catch ( e ) {
8182 console . error ( e ) ;
8283 }
You can’t perform that action at this time.
0 commit comments