summaryrefslogtreecommitdiff
path: root/src/lib/services/llm.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/services/llm.ts')
-rw-r--r--src/lib/services/llm.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/services/llm.ts b/src/lib/services/llm.ts
new file mode 100644
index 0000000..508423f
--- /dev/null
+++ b/src/lib/services/llm.ts
@@ -0,0 +1,16 @@
+import AIModelAPI, { type LLMChoice } from "sortug-ai";
+import type { AsyncRes } from "@/lib/types";
+
+export class LLM {
+ private api;
+ constructor(model: LLMChoice) {
+ const api = AIModelAPI(model);
+ this.api = api;
+ }
+
+ async chat(text: string): AsyncRes<string> {
+ const res = await this.api.send(text);
+ console.log({ res });
+ return res;
+ }
+}