Skip to content

Commit fa013c9

Browse files
committed
add gpt-4o
1 parent 92d46a3 commit fa013c9

File tree

5 files changed

+36
-9
lines changed

5 files changed

+36
-9
lines changed

app/api/retrieval/process/route.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,11 @@ export async function POST(req: Request) {
6666
checkApiKey(profile.openai_api_key, "OpenAI")
6767
}
6868
} catch (error: any) {
69-
error.message = error.message + ", make sure it is configured or else use local embeddings"
70-
throw(error)
71-
}
69+
error.message =
70+
error.message +
71+
", make sure it is configured or else use local embeddings"
72+
throw error
73+
}
7274
}
7375

7476
let chunks: FileItemChunk[] = []

db/files.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ export const createFile = async (
138138
if (!response.ok) {
139139
const jsonText = await response.text()
140140
const json = JSON.parse(jsonText)
141-
console.error(`Error processing file:${createdFile.id}, status:${response.status}, response:${json.message}`)
141+
console.error(
142+
`Error processing file:${createdFile.id}, status:${response.status}, response:${json.message}`
143+
)
142144
toast.error("Failed to process file. Reason:" + json.message, {
143145
duration: 10000
144146
})
@@ -200,7 +202,9 @@ export const createDocXFile = async (
200202
if (!response.ok) {
201203
const jsonText = await response.text()
202204
const json = JSON.parse(jsonText)
203-
console.error(`Error processing file:${createdFile.id}, status:${response.status}, response:${json.message}`)
205+
console.error(
206+
`Error processing file:${createdFile.id}, status:${response.status}, response:${json.message}`
207+
)
204208
toast.error("Failed to process file. Reason:" + json.message, {
205209
duration: 10000
206210
})

lib/models/llm/groq-llm-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const LLaMA3_8B: LLM = {
1313
currency: "USD",
1414
unit: "1M tokens",
1515
inputCost: 0.05,
16-
outputCost: 0.10
16+
outputCost: 0.1
1717
}
1818
}
1919

lib/models/llm/openai-llm-list.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ import { LLM } from "@/types"
33
const OPENAI_PLATORM_LINK = "https://platform.openai.com/docs/overview"
44

55
// OpenAI Models (UPDATED 1/25/24) -----------------------------
6+
const GPT4o: LLM = {
7+
modelId: "gpt-4o",
8+
modelName: "GPT-4o",
9+
provider: "openai",
10+
hostedId: "gpt-4o",
11+
platformLink: OPENAI_PLATORM_LINK,
12+
imageInput: true,
13+
pricing: {
14+
currency: "USD",
15+
unit: "1M tokens",
16+
inputCost: 5,
17+
outputCost: 15
18+
}
19+
}
620

721
// GPT-4 Turbo (UPDATED 1/25/24)
822
const GPT4Turbo: LLM = {
@@ -11,7 +25,7 @@ const GPT4Turbo: LLM = {
1125
provider: "openai",
1226
hostedId: "gpt-4-turbo-preview",
1327
platformLink: OPENAI_PLATORM_LINK,
14-
imageInput: false,
28+
imageInput: true,
1529
pricing: {
1630
currency: "USD",
1731
unit: "1M tokens",
@@ -67,4 +81,10 @@ const GPT3_5Turbo: LLM = {
6781
}
6882
}
6983

70-
export const OPENAI_LLM_LIST: LLM[] = [GPT4Turbo, GPT4Vision, GPT4, GPT3_5Turbo]
84+
export const OPENAI_LLM_LIST: LLM[] = [
85+
GPT4o,
86+
GPT4Turbo,
87+
GPT4Vision,
88+
GPT4,
89+
GPT3_5Turbo
90+
]

types/llms.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ export type LLMID =
88
| GroqLLMID
99
| PerplexityLLMID
1010

11-
// OpenAI Models (UPDATED 1/29/24)
11+
// OpenAI Models (UPDATED 5/13/24)
1212
export type OpenAILLMID =
13+
| "gpt-4o" // GPT-4o
1314
| "gpt-4-turbo-preview" // GPT-4 Turbo
1415
| "gpt-4-vision-preview" // GPT-4 Vision
1516
| "gpt-4" // GPT-4

0 commit comments

Comments
 (0)