Skip to content

Commit

Permalink
Use GPT-4o mini
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jul 19, 2024
1 parent 0e57d4c commit ff1ecce
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@ai-sdk/openai": "^0.0.34",
"@ai-sdk/openai": "^0.0.36",
"@baselime/node-opentelemetry": "^0.5.8",
"@date-fns/utc": "^1.2.0",
"@hookform/resolvers": "^3.6.0",
Expand All @@ -39,7 +39,7 @@
"@upstash/ratelimit": "^1.2.1",
"@vercel/speed-insights": "^1.0.12",
"@zip.js/zip.js": "2.7.45",
"ai": "^3.2.16",
"ai": "^3.2.29",
"change-case": "^5.4.4",
"dub": "^0.29.18",
"framer-motion": "^11.2.12",
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/src/actions/ai/chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ratelimit = new Ratelimit({
});

export async function submitUserMessage(
content: string
content: string,
): Promise<ClientMessage> {
"use server";
const ip = headers().get("x-forwarded-for");
Expand Down Expand Up @@ -92,7 +92,7 @@ export async function submitUserMessage(
let textNode: undefined | React.ReactNode;

const result = await streamUI({
model: openai("gpt-4o"),
model: openai("gpt-4o-mini"),
initial: <SpinnerMessage />,
system: `\
You are a helpful assistant in Midday who can help users ask questions about their transactions, revenue, spending find invoices and more.
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/actions/ai/chat/tools/forecast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function getForecastTool({ aiState, currency, dateFrom, dateTo }: Args) {
});

const { text } = await generateText({
model: openai("gpt-4o"),
model: openai("gpt-4o-mini"),
system:
"You are a financial forecaster and analyst. Your task is to provide simple, clear, and concise content. Return only the result with a short description only with text. Make sure to mention that this is an indication of the forecast and should be verified.",
prompt: `forecast next month ${type} based on the last 12 months ${type}:\n${prev}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/actions/ai/get-vat-rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getVatRateSchema } from "../schema";

const model = new ChatOpenAI({
temperature: 0,
model: "gpt-4o",
model: "gpt-4o-mini",
apiKey: process.env.OPENAI_API_KEY,
});

Expand Down
Binary file modified bun.lockb
Binary file not shown.

0 comments on commit ff1ecce

Please sign in to comment.