Skip to content

Commit

Permalink
feat(backend): throw correct error message when no name passed
Browse files Browse the repository at this point in the history
Ref: #298
Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
  • Loading branch information
Tomas2D committed Feb 11, 2025
1 parent df1e2bf commit 0dffc8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/backend/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ function findProviderDef(value: string): ProviderDef | null {
}

export function parseModel(name: string) {
if (!name) {
throw new ValueError("Neither 'provider' nor 'provider:model' was specified.");
}
const [providerId, modelId] = name.split(":") as [ProviderName, string];
const providerDef = findProviderDef(providerId);
if (!providerDef) {
Expand Down

0 comments on commit 0dffc8f

Please sign in to comment.