make explicit that nearVector can't be nil if nearText is nil
@@ -299,9 +299,15 @@ func (e *Explorer) vectorFromParams(ctx context.Context,
return vector, nil
}
+ if params.NearVector != nil {
return params.NearVector.Vector, nil
}
+ // either nearText or nearVector has to be set, so if we land here, something
+ // has gone very wrong
+ panic("vectorFromParams was called without any known params present")
+}
+
func (e *Explorer) vectorFromNearTextParams(ctx context.Context,
params *NearTextParams) ([]float32, error) {
vector, err := e.vectorizer.Corpi(ctx, params.Values)
