Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump ai sdk version #585

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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