File size: 422 Bytes
624088c
 
287a603
3ca0269
 
287a603
e1c1857
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"use server"

import { LLMEngine } from "@/types"

const llmEngine = `${process.env.LLM_ENGINE || ""}` as LLMEngine

export const predict = async () => {
    if (llmEngine === "OPENAI")  {
        const module = await import("./predictWithOpenAI")  
        return module.predictWithOpenAI
    } else {
        const module = await import("./predictWithHuggingFace")  
        return module.predictWithHuggingFace
    }
}