Skip to content

Commit da0ecc2

Browse files
committed
Fix after changes in tools
1 parent 608ad03 commit da0ecc2

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

examples/llama/screens/ChatScreen.tsx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)