Skip to content

Commit 73f7d7b

Browse files
committed
fix compatible models
1 parent 4c013b3 commit 73f7d7b

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

components/chat/chat-hooks/use-scroll.tsx

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { ChatbotUIContext } from "@/context/context"
2-
import { type UIEventHandler, useCallback, useContext, useEffect, useRef, useState } from "react"
2+
import {
3+
type UIEventHandler,
4+
useCallback,
5+
useContext,
6+
useEffect,
7+
useRef,
8+
useState
9+
} from "react"
310

411
export const useScroll = () => {
512
const { isGenerating, chatMessages } = useContext(ChatbotUIContext)
@@ -27,8 +34,8 @@ export const useScroll = () => {
2734
}
2835
}, [chatMessages])
2936

30-
const handleScroll: UIEventHandler<HTMLDivElement> = useCallback((e) => {
31-
const target = e.target as HTMLDivElement;
37+
const handleScroll: UIEventHandler<HTMLDivElement> = useCallback(e => {
38+
const target = e.target as HTMLDivElement
3239
const bottom =
3340
Math.round(target.scrollHeight) - Math.round(target.scrollTop) ===
3441
Math.round(target.clientHeight)

components/sidebar/items/assistants/create-assistant.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ export const CreateAssistant: FC<CreateAssistantProps> = ({
8989
if (!assistantChatSettings.model) return false
9090

9191
const compatibleModels = [
92-
"gpt-4-1106-preview",
92+
"gpt-4-turbo-preview",
9393
"gpt-4-vision-preview",
94-
"gpt-3.5-turbo-1106"
94+
"gpt-3.5-turbo-1106",
95+
"gpt-4"
9596
]
9697
const isModelCompatible = compatibleModels.includes(
9798
assistantChatSettings.model

db/storage/files.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const uploadFile = async (
1515
throw new Error(`File must be less than ${SIZE_LIMIT / 1000000}MB`)
1616
}
1717

18-
const filePath = `${payload.user_id}/${Buffer.from(payload.file_id).toString('base64')}`;
18+
const filePath = `${payload.user_id}/${Buffer.from(payload.file_id).toString("base64")}`
1919

2020
const { error } = await supabase.storage
2121
.from("files")
@@ -24,8 +24,8 @@ export const uploadFile = async (
2424
})
2525

2626
if (error) {
27-
console.log(`Error uploading file with path: ${filePath}`, error);
28-
throw new Error("Error uploading file");
27+
console.log(`Error uploading file with path: ${filePath}`, error)
28+
throw new Error("Error uploading file")
2929
}
3030

3131
return filePath

0 commit comments

Comments
 (0)