| 1 | import { LLMOptions } from "../.."; |
| 2 | import { LLMConfigurationStatuses } from "../constants"; |
| 3 | import { LlmApiRequestType } from "../openaiTypeConverters"; |
| 4 | |
| 5 | import OpenAI from "./OpenAI"; |
| 6 | |
| 7 | export class Relace extends OpenAI { |
| 8 | static providerName = "relace"; |
| 9 | static defaultOptions: Partial<LLMOptions> | undefined = { |
| 10 | apiBase: "https://instantapply.endpoint.relace.run/v1/", |
| 11 | }; |
| 12 | protected useOpenAIAdapterFor: (LlmApiRequestType | "*")[] = ["*"]; |
| 13 | |
| 14 | protected supportsPrediction(model: string): boolean { |
| 15 | return true; |
| 16 | } |
| 17 | |
| 18 | getConfigurationStatus() { |
| 19 | if (!this.apiKey) { |
| 20 | return LLMConfigurationStatuses.MISSING_API_KEY; |
| 21 | } |
| 22 | |
| 23 | return LLMConfigurationStatuses.VALID; |
| 24 | } |
| 25 | } |