| 1 | import { LLMOptions } from "../../index.js"; |
| 2 | |
| 3 | import OpenAI from "./OpenAI.js"; |
| 4 | |
| 5 | class xAI extends OpenAI { |
| 6 | static providerName = "xAI"; |
| 7 | static defaultOptions: Partial<LLMOptions> = { |
| 8 | apiBase: "https://api.x.ai/v1/", |
| 9 | }; |
| 10 | |
| 11 | private static MODEL_IDS: { [name: string]: string } = { |
| 12 | "grok-beta": "grok-beta", // Future names might not line up |
| 13 | }; |
| 14 | |
| 15 | protected _convertModelName(model: string) { |
| 16 | return xAI.MODEL_IDS[model] || this.model; |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export default xAI; |