Skip to content

Commit 8858b0a

Browse files
fix: update cerebras provider implementation to match model changes
1 parent b90cdcd commit 8858b0a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/api/providers/cerebras.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ export class CerebrasHandler extends BaseProvider implements SingleCompletionHan
4646
}
4747

4848
getModel(): { id: CerebrasModelId; info: (typeof cerebrasModels)[CerebrasModelId] } {
49-
const modelId = (this.options.apiModelId as CerebrasModelId) || this.defaultProviderModelId
49+
const modelId = this.options.apiModelId as CerebrasModelId
50+
const validModelId = modelId && this.providerModels[modelId] ? modelId : this.defaultProviderModelId
5051

5152
return {
52-
id: modelId,
53-
info: this.providerModels[modelId],
53+
id: validModelId,
54+
info: this.providerModels[validModelId],
5455
}
5556
}
5657

0 commit comments

Comments
 (0)