diff --git a/app/src/app/api/image/route.ts b/app/src/app/api/image/route.ts index df461b2..e8be7ee 100644 --- a/app/src/app/api/image/route.ts +++ b/app/src/app/api/image/route.ts @@ -40,7 +40,7 @@ export async function GET( } // 画像URLからキャプションを生成する関数 -export const generateCaption = async (imageUrl: string) => { +const generateCaption = async (imageUrl: string) => { try { const completion = await openai.chat.completions.create({ model: "gpt-4o", diff --git a/app/src/app/api/minio/route.ts b/app/src/app/api/minio/route.ts index ec4ba05..573c84e 100644 --- a/app/src/app/api/minio/route.ts +++ b/app/src/app/api/minio/route.ts @@ -1,6 +1,7 @@ import * as fs from "node:fs"; import type { IncomingMessage } from "node:http"; import { Readable } from "node:stream"; +import { generateCaption } from "@/functions/gpt"; import { scoreRegister } from "@/functions/scoreRegister"; import { shapeCaption } from "@/functions/shapeCaption"; import { postSimilarity } from "@/functions/simirality"; @@ -9,7 +10,6 @@ import type { ScoreData, ScoreResponse } from "@/types"; import { formidable } from "formidable"; import { Client } from "minio"; import type { NextRequest } from "next/server"; -import { generateCaption } from "../image/route"; const minioClient = new Client({ endPoint: process.env.NEXT_PUBLIC_ENDPOINT || "",