Skip to content

Commit

Permalink
refactor: move Gemini model changes to packages/web directory
Browse files Browse the repository at this point in the history
Co-Authored-By: ben <ben@prologe.io>
  • Loading branch information
devin-ai-integration[bot] and benjaminshafii committed Dec 23, 2024
1 parent 6951315 commit ac3c66d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/web/app/api/(newai)/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { NextResponse, NextRequest } from "next/server";
import { incrementAndLogTokenUsage } from "@/lib/incrementAndLogTokenUsage";
import { handleAuthorization } from "@/lib/handleAuthorization";
import { z } from "zod";
import { google } from "@ai-sdk/google";
import type { GoogleGenerativeAIProviderMetadata } from "@ai-sdk/google";

import { getModel } from "@/lib/models";
import { getChatSystemPrompt } from "@/lib/prompts/chat-prompt";

export const maxDuration = 60;
const MODEL_NAME = process.env.MODEL_NAME || "gemini-2.0-flash-exp";
const MODEL_NAME = process.env.MODEL_NAME;

const settingsSchema = z.object({
renameInstructions: z.string().optional(),
Expand Down Expand Up @@ -40,9 +38,6 @@ export async function POST(req: NextRequest) {
})
.join("\n\n");

// Extract metadata for Gemini model if applicable
const isGeminiModel = MODEL_NAME === "gemini-2.0-flash-exp";

const result = await streamText({
model,
system: getChatSystemPrompt(
Expand Down

0 comments on commit ac3c66d

Please sign in to comment.