From adc40cf770cb8acff1182621461c6ff8c686ee40 Mon Sep 17 00:00:00 2001
From: Thuc Pham <51660321+thucpn@users.noreply.github.com>
Date: Fri, 13 Sep 2024 18:55:46 +0700
Subject: [PATCH] fix: vercel ai update crash sending annotations (#287)

* fix: vercel ai update crash sending annotations

* Create five-ties-happen.md
---
 .changeset/five-ties-happen.md                               | 5 +++++
 templates/types/streaming/express/package.json               | 2 +-
 .../types/streaming/nextjs/app/components/chat-section.tsx   | 1 +
 templates/types/streaming/nextjs/package.json                | 2 +-
 4 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 .changeset/five-ties-happen.md

diff --git a/.changeset/five-ties-happen.md b/.changeset/five-ties-happen.md
new file mode 100644
index 00000000..2af74f88
--- /dev/null
+++ b/.changeset/five-ties-happen.md
@@ -0,0 +1,5 @@
+---
+"create-llama": patch
+---
+
+fix: vercel ai update crash sending annotations
diff --git a/templates/types/streaming/express/package.json b/templates/types/streaming/express/package.json
index 569a6986..26741e8d 100644
--- a/templates/types/streaming/express/package.json
+++ b/templates/types/streaming/express/package.json
@@ -15,7 +15,7 @@
     "dev": "concurrently \"tsup index.ts --format esm --dts --watch\" \"nodemon --watch dist/index.js\""
   },
   "dependencies": {
-    "ai": "^3.0.21",
+    "ai": "3.0.21",
     "cors": "^2.8.5",
     "dotenv": "^16.3.1",
     "duck-duck-scrape": "^2.2.5",
diff --git a/templates/types/streaming/nextjs/app/components/chat-section.tsx b/templates/types/streaming/nextjs/app/components/chat-section.tsx
index 7fcf188d..e7e489ba 100644
--- a/templates/types/streaming/nextjs/app/components/chat-section.tsx
+++ b/templates/types/streaming/nextjs/app/components/chat-section.tsx
@@ -29,6 +29,7 @@ export default function ChatSection() {
       const message = JSON.parse(error.message);
       alert(message.detail);
     },
+    sendExtraMessageFields: true,
   });
 
   return (
diff --git a/templates/types/streaming/nextjs/package.json b/templates/types/streaming/nextjs/package.json
index 8d81b32d..fea9676e 100644
--- a/templates/types/streaming/nextjs/package.json
+++ b/templates/types/streaming/nextjs/package.json
@@ -17,7 +17,7 @@
     "@radix-ui/react-hover-card": "^1.0.7",
     "@radix-ui/react-select": "^2.1.1",
     "@radix-ui/react-slot": "^1.0.2",
-    "ai": "^3.0.21",
+    "ai": "3.0.21",
     "ajv": "^8.12.0",
     "class-variance-authority": "^0.7.0",
     "clsx": "^2.1.1",
-- 
GitLab