Skip to content

Commit a6a9a8a

Browse files
committed
fix: small tweak to check-user-calendar (addHours -> addDays)
1 parent 37a1444 commit a6a9a8a

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

examples/calling-apis/chatbot/app/(ai-sdk)/lib/tools/check-user-calendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { tool } from "ai";
2-
import { addHours, formatISO } from "date-fns";
2+
import { addDays, formatISO } from "date-fns";
33
import { GaxiosError } from "gaxios";
44
import { google } from "googleapis";
55
import { z } from "zod/v3";
@@ -32,7 +32,7 @@ export const checkUsersCalendar = withGoogleCalendar(
3232
auth,
3333
requestBody: {
3434
timeMin: formatISO(date),
35-
timeMax: addHours(date, 1).toISOString(),
35+
timeMax: addDays(date, 1).toISOString(),
3636
timeZone: "UTC",
3737
items: [{ id: "primary" }],
3838
},

examples/calling-apis/chatbot/app/(genkit)/lib/tools/check-user-calendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addHours, formatISO } from "date-fns";
1+
import { addDays, formatISO } from "date-fns";
22
import { GaxiosError } from "gaxios";
33
import { google } from "googleapis";
44
import { z } from "zod/v3";
@@ -40,7 +40,7 @@ export const checkUsersCalendar = ai.defineTool(
4040
auth,
4141
requestBody: {
4242
timeMin: formatISO(date),
43-
timeMax: addHours(date, 1).toISOString(),
43+
timeMax: addDays(date, 1).toISOString(),
4444
timeZone: "UTC",
4545
items: [{ id: "primary" }],
4646
},

examples/calling-apis/chatbot/app/(langgraph)/lib/tools/check-user-calendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addHours, formatISO } from "date-fns";
1+
import { addDays, formatISO } from "date-fns";
22
import { GaxiosError } from "gaxios";
33
import { google } from "googleapis";
44
import { z } from "zod/v3";
@@ -27,7 +27,7 @@ export const checkUsersCalendar = withGoogleCalendar(
2727
auth,
2828
requestBody: {
2929
timeMin: formatISO(date),
30-
timeMax: addHours(date, 1).toISOString(),
30+
timeMax: addDays(date, 1).toISOString(),
3131
timeZone: "UTC",
3232
items: [{ id: "primary" }],
3333
},

examples/calling-apis/chatbot/app/(llamaindex)/lib/tools/check-user-calendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addHours, formatISO } from "date-fns";
1+
import { addDays, formatISO } from "date-fns";
22
import { GaxiosError } from "gaxios";
33
import { google } from "googleapis";
44
import { tool } from "llamaindex";
@@ -28,7 +28,7 @@ export const checkUsersCalendar = () =>
2828
auth,
2929
requestBody: {
3030
timeMin: formatISO(date),
31-
timeMax: addHours(date, 1).toISOString(),
31+
timeMax: addDays(date, 1).toISOString(),
3232
timeZone: "UTC",
3333
items: [{ id: "primary" }],
3434
},

packages/ai-genkit/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Then use the `withGoogleAccess` to wrap the tool and use `getAccessTokenFromToke
8383
```javascript
8484
import { getAccessTokenFromTokenVault } from "@auth0/ai-genkit";
8585
import { TokenVaultError } from "@auth0/ai/interrupts";
86-
import { addHours } from "date-fns";
86+
import { addDays } from "date-fns";
8787
import { z } from "zod";
8888

8989
export const checkCalendarTool = ai.defineTool(
@@ -102,7 +102,7 @@ export const checkCalendarTool = ai.defineTool(
102102
const accessToken = getAccessTokenFromTokenVault();
103103
const body = JSON.stringify({
104104
timeMin: date,
105-
timeMax: addHours(date, 1),
105+
timeMax: addDays(date, 1),
106106
timeZone: "UTC",
107107
items: [{ id: "primary" }],
108108
});

packages/ai-langchain/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ Then use the `withGoogleAccess` to wrap the tool and use `getAccessTokenFromToke
7878
import { tool } from "@langchain/core/tools";
7979
import { getAccessTokenFromTokenVault } from "@auth0/ai-langchain";
8080
import { TokenVaultError } from "@auth0/ai/interrupts";
81-
import { addHours } from "date-fns";
81+
import { addDays } from "date-fns";
8282

8383
export const checkCalendarTool = withGoogleAccess(
8484
tool(
8585
async ({ date }) => {
8686
const accessToken = getAccessTokenFromTokenVault();
8787
const body = JSON.stringify({
8888
timeMin: date,
89-
timeMax: addHours(date, 1),
89+
timeMax: addDays(date, 1),
9090
timeZone: "UTC",
9191
items: [{ id: "primary" }],
9292
});

packages/ai-llamaindex/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ Then use the `withGoogleAccess` to wrap the tool and use `getAccessTokenFromToke
8282
import { tool } from "llamaindex";
8383
import { getAccessTokenFromTokenVault } from "@auth0/ai-llamaindex";
8484
import { TokenVaultError } from "@auth0/ai/interrupts";
85-
import { addHours } from "date-fns";
85+
import { addDays } from "date-fns";
8686

8787
export const checkUsersCalendar = withGoogleAccess(
8888
tool(async ({ date }) => {
8989
const accessToken = getAccessTokenFromTokenVault();
9090
const url = "https://www.googleapis.com/calendar/v3/freeBusy";
9191
const body = JSON.stringify({
9292
timeMin: date,
93-
timeMax: addHours(date, 1),
93+
timeMax: addDays(date, 1),
9494
timeZone: "UTC",
9595
items: [{ id: "primary" }],
9696
});

packages/ai-vercel/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Then use the `withGoogleAccess` to wrap the tool and use `getAccessTokenFromToke
8080
import { tool } from "ai";
8181
import { getAccessTokenFromTokenVault } from "@auth0/ai-vercel";
8282
import { TokenVaultError } from "@auth0/ai/interrupts";
83-
import { addHours } from "date-fns";
83+
import { addDays } from "date-fns";
8484

8585
export const checkUsersCalendar = withGoogleAccess(
8686
tool({
@@ -94,7 +94,7 @@ export const checkUsersCalendar = withGoogleAccess(
9494
const url = "https://www.googleapis.com/calendar/v3/freeBusy";
9595
const body = JSON.stringify({
9696
timeMin: date,
97-
timeMax: addHours(date, 1),
97+
timeMax: addDays(date, 1),
9898
timeZone: "UTC",
9999
items: [{ id: "primary" }],
100100
});

0 commit comments

Comments
 (0)