Resolve smoke-test targets
This commit is contained in:
@@ -76,14 +76,22 @@ func (r *Runner) resolveProfileIdentity(ctx context.Context, profileID string) (
|
||||
}
|
||||
|
||||
func normalizeResolvedExecutionTarget(target domain.ExecutionTarget) (domain.ExecutionTarget, error) {
|
||||
target, err := normalizeResolvedExecutionSettings(target)
|
||||
if err != nil {
|
||||
return domain.ExecutionTarget{}, err
|
||||
}
|
||||
if strings.TrimSpace(target.Model) == "" {
|
||||
return domain.ExecutionTarget{}, errors.New("execution model is required")
|
||||
}
|
||||
return target, nil
|
||||
}
|
||||
|
||||
func normalizeResolvedExecutionSettings(target domain.ExecutionTarget) (domain.ExecutionTarget, error) {
|
||||
endpoint, err := domain.NormalizeOpenAICompatibleBaseEndpoint(target.Endpoint)
|
||||
if err != nil {
|
||||
return domain.ExecutionTarget{}, fmt.Errorf("execution endpoint: %w", err)
|
||||
}
|
||||
target.Endpoint = endpoint
|
||||
if strings.TrimSpace(target.Model) == "" {
|
||||
return domain.ExecutionTarget{}, errors.New("execution model is required")
|
||||
}
|
||||
if err := domain.ValidateExecutionTargetSettings(target); err != nil {
|
||||
return domain.ExecutionTarget{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user