public static Set<Class<?>> getAllClassesInType(Class<?> clazz) {
		log.debug("finding types for " + clazz.getName());
		Set<Class<?>> all = new HashSet<>();
		all.add(clazz);
		all.addAll(Arrays.asList(ClassUtils.getAllInterfacesForClass(clazz)));
		Class<?> parent;
		Class<?> c = clazz;
		while ((parent = c.getSuperclass()) != null && !parent.equals(Object.class)) {
			all.add(parent);
			c = c.getSuperclass();
		}
		return all;
	}
Extract GPT functions from class (and all parent classes/interfaces) by scanning
methods with {@code @GPTFunction}.
@param clazz the Java class whose hierarchy we need to search
@return all functions annotated with
{@code @GPTFunction the @GPTFunction annotation}
src/main/java/org/mvnsearch/chatgpt/model/function/GPTFunctionUtils.java