summaryrefslogtreecommitdiff
path: root/src/lib/services/llm.ts
blob: 508423fc7d3979696c96d75199b4c2b85142fbcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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;
  }
}