Skip to content

Commit 2edb8b7

Browse files
committed
inline
1 parent c064456 commit 2edb8b7

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

src/services/ghost/GhostModel.ts

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,18 @@ export class GhostModel {
4040
if (!(await checkKilocodeBalance(profile.kilocodeToken, profile.kilocodeOrganizationId))) continue
4141
}
4242

43-
this.loadProfile(providerSettingsManager, selectedProfile, provider)
43+
const profile = await providerSettingsManager.getProfile({
44+
id: selectedProfile.id,
45+
})
46+
47+
this.apiHandler = buildApiHandler({
48+
...profile,
49+
[modelIdKeysByProvider[provider]]: AUTOCOMPLETE_PROVIDER_MODELS[provider],
50+
})
51+
52+
if (this.apiHandler instanceof OpenRouterHandler) {
53+
await this.apiHandler.fetchModel()
54+
}
4455
this.loaded = true
4556
return true
4657
}
@@ -49,25 +60,6 @@ export class GhostModel {
4960
return false
5061
}
5162

52-
public async loadProfile(
53-
providerSettingsManager: ProviderSettingsManager,
54-
selectedProfile: ProviderSettingsEntry,
55-
provider: keyof typeof AUTOCOMPLETE_PROVIDER_MODELS,
56-
): Promise<void> {
57-
const profile = await providerSettingsManager.getProfile({
58-
id: selectedProfile.id,
59-
})
60-
61-
this.apiHandler = buildApiHandler({
62-
...profile,
63-
[modelIdKeysByProvider[provider]]: AUTOCOMPLETE_PROVIDER_MODELS[provider],
64-
})
65-
66-
if (this.apiHandler instanceof OpenRouterHandler) {
67-
await this.apiHandler.fetchModel()
68-
}
69-
}
70-
7163
/**
7264
* Generate response with streaming callback support
7365
*/

0 commit comments

Comments
 (0)