public static Object[] convertRecordToArray(@NotNull Object obj) {
		RecordComponent[] fields = obj.getClass().getRecordComponents();
		Object[] args = new Object[fields.length];
		for (int i = 0; i < fields.length; i++) {
			try {
				final Object value = fields[i].getAccessor().invoke(obj);
				args[i] = value;
			}
			catch (Exception ignore) {
				args[i] = null;
			}
		}
		return args;
	}
GraalVM native image compatible
@param genericType generic type
@return item class
src/main/java/org/mvnsearch/chatgpt/model/function/GPTFunctionUtils.java