Spaces:
Sleeping
Sleeping
Download src/app/queries/getLLMEngineFunction.ts from ClickyGPT/comic-court: direct link, hf CLI and curl.
- Browser
- Download file 801 Bytes
-
https://huggingface.co/spaces/ClickyGPT/comic-court/resolve/main/src/app/queries/getLLMEngineFunction.ts
- Command line
-
hf download hf://spaces/ClickyGPT/comic-court/src/app/queries/getLLMEngineFunction.ts
-
curl -L -o getLLMEngineFunction.ts https://huggingface.co/spaces/ClickyGPT/comic-court/resolve/main/src/app/queries/getLLMEngineFunction.ts
801 Bytes
| import { LLMEngine } from "@/types" | |
| import { predict as predictWithHuggingFace } from "./predictWithHuggingFace" | |
| import { predict as predictWithOpenAI } from "./predictWithOpenAI" | |
| import { predict as predictWithGroq } from "./predictWithGroq" | |
| import { predict as predictWithAnthropic } from "./predictWithAnthropic" | |
| export const defaultLLMEngineName = `${process.env.LLM_ENGINE || ""}` as LLMEngine | |
| export function getLLMEngineFunction(llmEngineName: LLMEngine = defaultLLMEngineName) { | |
| const llmEngineFunction = | |
| llmEngineName === "GROQ" ? predictWithGroq : | |
| llmEngineName === "ANTHROPIC" ? predictWithAnthropic : | |
| llmEngineName === "OPENAI" ? predictWithOpenAI : | |
| predictWithHuggingFace | |
| return llmEngineFunction | |
| } | |
| export const defaultLLMEngineFunction = getLLMEngineFunction() |