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

Fix #37 by upgrading Next.js to 15.x #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion app/api/assistants/threads/[threadId]/actions/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { openai } from "@/app/openai";

// Send a new message to a thread
export async function POST(request, { params: { threadId } }) {
export async function POST(request, { params }) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the code to resolve the error with Next.js 15

const { threadId } = await params;
const { toolCallOutputs, runId } = await request.json();

const stream = openai.beta.threads.runs.submitToolOutputsStream(
Expand Down
3 changes: 2 additions & 1 deletion app/api/assistants/threads/[threadId]/messages/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { openai } from "@/app/openai";
export const runtime = "nodejs";

// Send a new message to a thread
export async function POST(request, { params: { threadId } }) {
export async function POST(request, { params }) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

const { threadId } = await params;
const { content } = await request.json();

await openai.beta.threads.messages.create(threadId, {
Expand Down
Loading