File size: 461 Bytes
624088c
 
287a603
6463491
 
a2c0551
3ca0269
 
287a603
a2c0551
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"use server"

import { LLMEngine } from "@/types"
import { predict as predictWithHuggingFace } from "./predictWithHuggingFace"
import { predict as predictWithOpenAI } from "./predictWithOpenAI"
import { predict as predictWithGroq } from "./predictWithGroq"

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

export const predict =
  llmEngine === "GROQ" ? predictWithGroq :
  llmEngine === "OPENAI" ? predictWithOpenAI :
  predictWithHuggingFace