Skip to content

Commit dc3614d

Browse files
committed
update readme altair example
1 parent 308f09d commit dc3614d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function Altair() {
3737

3838
useEffect(() => {
3939
setConfig({
40-
model: "models/gemini-v3-s-test",
40+
model: "models/gemini-2.0-flash-exp",
4141
systemInstruction: {
4242
parts: [
4343
{
@@ -50,7 +50,7 @@ export function Altair() {
5050
}, [setConfig]);
5151

5252
useEffect(() => {
53-
client.on("toolcall", (toolCall) => {
53+
const onToolCall = (toolCall: ToolCall) => {
5454
console.log(`got toolcall`, toolCall);
5555
const fc = toolCall.functionCalls.find(
5656
(fc) => fc.name === declaration.name
@@ -59,7 +59,11 @@ export function Altair() {
5959
const str = (fc.args as any).json_graph;
6060
setJSONString(str);
6161
}
62-
});
62+
};
63+
client.on("toolcall", onToolCall);
64+
return () => {
65+
client.off("toolcall", onToolCall);
66+
};
6367
}, [client]);
6468

6569
const embedRef = useRef<HTMLDivElement>(null);

0 commit comments

Comments
 (0)