Skip to content

Commit

Permalink
fix for local demo (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgrammel authored Jun 26, 2024
1 parent 155a199 commit 6600bcc
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 30 deletions.
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Toaster } from '@/components/ui/sonner'
import { KasadaClient } from '@/lib/kasada/kasada-client'

export const metadata = {
metadataBase: new URL(process.env.VERCEL_PROJECT_PRODUCTION_URL!),
metadataBase: new URL('https://gemini.vercel.ai'),
title: {
default: 'Next.js Gemini Chatbot',
template: `%s - Next.js Gemini Chatbot`
Expand Down
12 changes: 6 additions & 6 deletions lib/chat/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import { BoardingPass } from '@/components/flights/boarding-pass'
import { PurchaseTickets } from '@/components/flights/purchase-ticket'
import { CheckIcon, SpinnerIcon } from '@/components/ui/icons'
import { format } from 'date-fns'
import { experimental_streamText } from 'ai'
import { google } from 'ai/google'
import { streamText } from 'ai'
import { google } from '@ai-sdk/google'
import { GoogleGenerativeAI } from '@google/generative-ai'
import { z } from 'zod'
import { ListHotels } from '@/components/hotels/list-hotels'
Expand Down Expand Up @@ -161,8 +161,8 @@ async function submitUserMessage(content: string) {

;(async () => {
try {
const result = await experimental_streamText({
model: google.generativeAI('models/gemini-1.5-flash'),
const result = await streamText({
model: google('models/gemini-1.5-flash'),
temperature: 0,
tools: {
showFlights: {
Expand Down Expand Up @@ -204,12 +204,12 @@ async function submitUserMessage(content: string) {
},
showHotels: {
description: 'Show the UI to choose a hotel for the trip.',
parameters: z.object({})
parameters: z.object({ city: z.string() })
},
checkoutBooking: {
description:
'Show the UI to purchase/checkout a flight and hotel booking.',
parameters: z.object({})
parameters: z.object({ shouldConfirm: z.boolean() })
},
showBoardingPass: {
description: "Show user's imaginary boarding pass.",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"format:check": "prettier --check \"{app,lib,components}**/*.{ts,tsx,mdx}\" --cache"
},
"dependencies": {
"@ai-sdk/google": "0.0.23",
"@google/generative-ai": "^0.3.1",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-dialog": "^1.0.5",
Expand All @@ -28,7 +29,7 @@
"@vercel/analytics": "^1.1.2",
"@vercel/kv": "^1.0.1",
"@vercel/og": "^0.6.2",
"ai": "^3.0.17",
"ai": "^3.2.10",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"d3-scale": "^4.0.2",
Expand Down
171 changes: 149 additions & 22 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6600bcc

Please sign in to comment.