Skip to content

Commit

Permalink
Bump ai sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyphilemon committed Dec 3, 2024
1 parent 11a16b8 commit 096648b
Show file tree
Hide file tree
Showing 3 changed files with 3,375 additions and 4,105 deletions.
12 changes: 6 additions & 6 deletions app/(chat)/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export async function POST(request: Request) {

const streamingData = new StreamData();

const result = await streamText({
const result = streamText({
model: customModel(model.apiIdentifier),
system: systemPrompt,
messages: coreMessages,
Expand Down Expand Up @@ -135,7 +135,7 @@ export async function POST(request: Request) {
content: '',
});

const { fullStream } = await streamText({
const { fullStream } = streamText({
model: customModel(model.apiIdentifier),
system:
'Write about the given topic. Markdown is supported. Use headings wherever appropriate.',
Expand Down Expand Up @@ -199,7 +199,7 @@ export async function POST(request: Request) {
content: document.title,
});

const { fullStream } = await streamText({
const { fullStream } = streamText({
model: customModel(model.apiIdentifier),
system:
'You are a helpful writing assistant. Based on the description, please update the piece of writing.',
Expand Down Expand Up @@ -272,7 +272,7 @@ export async function POST(request: Request) {
Omit<Suggestion, 'userId' | 'createdAt' | 'documentCreatedAt'>
> = [];

const { elementStream } = await streamObject({
const { elementStream } = streamObject({
model: customModel(model.apiIdentifier),
system:
'You are a help writing assistant. Given a piece of writing, please offer suggestions to improve the piece of writing and describe the change. It is very important for the edits to contain full sentences instead of just words. Max 5 suggestions.',
Expand Down Expand Up @@ -326,11 +326,11 @@ export async function POST(request: Request) {
},
},
},
onFinish: async ({ responseMessages }) => {
onFinish: async ({ response }) => {
if (session.user?.id) {
try {
const responseMessagesWithoutIncompleteToolCalls =
sanitizeResponseMessages(responseMessages);
sanitizeResponseMessages(response.messages);

await saveMessages({
messages: responseMessagesWithoutIncompleteToolCalls.map(
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"db:up": "drizzle-kit up"
},
"dependencies": {
"@ai-sdk/openai": "1.0.0-canary.3",
"@ai-sdk/openai": "1.0.6",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.1",
Expand All @@ -32,7 +32,7 @@
"@vercel/analytics": "^1.3.1",
"@vercel/blob": "^0.24.1",
"@vercel/postgres": "^0.10.0",
"ai": "4.0.0-canary.9",
"ai": "4.0.10",
"bcrypt-ts": "^5.0.2",
"class-variance-authority": "^0.7.0",
"classnames": "^2.5.1",
Expand Down
Loading

0 comments on commit 096648b

Please sign in to comment.