This commit is contained in:
hailin 2025-05-28 22:39:32 +08:00
parent 467884c0df
commit b7498e3bb2
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,9 @@ import OpenAI from "openai"
import { getRuntimeEnv } from "@/lib/ipconfig" // 新增引入
export async function POST(request: Request) {
console.log("......[retrieve] request=", request)
const json = await request.json()
const { userInput, fileIds, embeddingsProvider, sourceCount } = json as {
userInput: string
@ -88,6 +91,7 @@ export async function POST(request: Request) {
} else if (embeddingsProvider === "bge-m3"){
// 示例:调用你自己的 BGE-M3 API 或本地函数
// 新增:使用 BGE-M3 嵌入
console.log("......[retrieve] userInput=",userInput)
const bgeEmbedding = await generateBgeM3Embedding(userInput)
// 调用对应的 RPC需要在数据库侧提前定义 match_file_items_bge_m3