Skip to content

Commit ec9e115

Browse files
committed
refactor: make abstract methods on parent LLM class protected
1 parent 10110c1 commit ec9e115

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/lib/llm/services/llm-service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ export type LlmProvider = AnthropicProvider | OllamaProvider | OpenAICompatibleP
1717
export abstract class LlmService {
1818
constructor(protected config: Config) {}
1919

20-
abstract getAvailableModelIds(): Promise<string[]>
21-
2220
async getModel(): Promise<LanguageModelV1> {
2321
const provider = await this.getProvider()
2422
const availableModelIds = await this.getAvailableModelIds()
@@ -29,5 +27,7 @@ export abstract class LlmService {
2927
return provider(modelId, {structuredOutputs: true})
3028
}
3129

32-
abstract getProvider(): Promise<LlmProvider>
30+
protected abstract getAvailableModelIds(): Promise<string[]>
31+
32+
protected abstract getProvider(): Promise<LlmProvider>
3333
}

src/lib/llm/services/lmstudio.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ export class LmStudio extends LlmService {
3636

3737
const models = await this.getAvailableModelIds()
3838

39+
invariant(models.length > 0, 'llm:no_models_found')
40+
3941
return new OpenAICompatibleChatLanguageModel(
4042
models[0],
4143
{},

0 commit comments

Comments
 (0)