Skip to content

Commit

Permalink
fix url
Browse files Browse the repository at this point in the history
  • Loading branch information
roodboi committed Nov 9, 2023
1 parent 7625453 commit 3efc846
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/ninety-spoons-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"next-assistants": patch
---

Fixing url for latest run
2 changes: 2 additions & 0 deletions packages/next-assistants/src/lib/oai.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use client"

import OpenAI from "openai"
import { ThreadCreateParams, Threads } from "openai/resources/beta/threads/threads"

Expand Down
2 changes: 1 addition & 1 deletion packages/next-assistants/src/lib/thread-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export class ThreadManager {
async checkForActiveRun() {
if (!this.threadId) throw new Error("Thread ID not provided")
const response = await fetch(
`/api/ai/assistants/${this.assistantId}/threads/${this.threadId}/runs/latest`
`/api/ai/assistants/${this.assistantId}/threads/${this.threadId}/runs/-/latest`
)

if (!response.ok) throw new Error("Failed to retrieve run")
Expand Down

0 comments on commit 3efc846

Please sign in to comment.