src/Service/Aliyun/OCRManager.php
public function getFixedFormat($images, array $options = [])
    {
        //aliyun does not support batch operation
        $images = is_array($images) ? $images[0] : $images;

        if (FileConverter::isUrl($images)) {
            throw new RuntimeException("Aliyun ocr not support online picture.");
        }

        if ($this->simpleRequestBody) {
            return [
                'image' => FileConverter::toBase64Encode($images),
                'configure' => json_encode($options, JSON_UNESCAPED_UNICODE)
            ];
        }

        //aliyun cloud fixed request format
        return [
            'inputs' => [
                [
                    'image' => [
                        'dataType' => 50,
                        'dataValue' => FileConverter::toBase64Encode($images)
                    ],
                    'configure' => [
                        'dataType' => 50,
                        'dataValue' => json_encode($options, JSON_UNESCAPED_UNICODE)
                    ]
                ]
            ]
        ];
    }
public function getFixedFormat($images, array $options = [])
    {
        //aliyun does not support batch operation
        $images = is_array($images) ? $images[0] : $images;

        if (FileConverter::isUrl($images)) {
            throw new RuntimeException("Aliyun ocr not support online picture.");
        }

        if ($this->simpleRequestBody) {
            return [
                'image' => FileConverter::toBase64Encode($images),
                'configure' => json_encode($options, JSON_UNESCAPED_UNICODE)
            ];
        }

        //aliyun cloud fixed request format
        return [
            'inputs' => [
                [
                    'image' => [
                        'dataType' => 50,
                        'dataValue' => FileConverter::toBase64Encode($images)
                    ],
                    'configure' => [
                        'dataType' => 50,
                        'dataValue' => json_encode($options, JSON_UNESCAPED_UNICODE)
                    ]
                ]
            ]
        ];
    }
Get aliyun fixed request format

@param  mixed $images
@param  array  $options

@return array