diff --git a/.idea/deployment.xml b/.idea/deployment.xml
deleted file mode 100644
index ee0a6e0..0000000
--- a/.idea/deployment.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/low-carbon-platform-php.iml b/.idea/low-carbon-platform-php.iml
deleted file mode 100644
index 877f80c..0000000
--- a/.idea/low-carbon-platform-php.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 8126e1a..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/php.xml b/.idea/php.xml
deleted file mode 100644
index a1827cd..0000000
--- a/.idea/php.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml
deleted file mode 100644
index 422c581..0000000
--- a/.idea/phpunit.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 35eb1dd..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 50729e1..2879688 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,125 +1,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $PROJECT_DIR$/composer.json
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {
- "customColor": "",
- "associatedIndex": 6
-}
-
-
-
-
-
{
"keyToString": {
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "WebServerToolWindowFactoryState": "false",
- "git-widget-placeholder": "master",
- "ignore.virus.scanning.warn.message": "true",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "reference.webide.settings.project.settings.php",
- "vue.rearranger.settings.migration": "true"
+ "settings.editor.selected.configurable": "configurable.group.appearance"
}
}
-
-
-
-
- 1712109998194
-
-
- 1712109998194
-
-
-
-
-
-
-
- 1712110130388
-
-
-
- 1712110130388
-
-
-
- 1712112106501
-
-
-
- 1712112106501
-
-
-
- 1712112345799
-
-
-
- 1712112345799
-
-
-
- 1712112490787
-
-
-
- 1712112490787
-
-
-
- 1712112777402
-
-
-
- 1712112777402
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 684e6ac..9245d6b 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -12,8 +12,14 @@ docs/Model/ChatParam.md
docs/Model/ChatParam.md
docs/Model/ChatResult.md
docs/Model/ChatResult.md
+docs/Model/ExtractTextParam.md
+docs/Model/ExtractTextParam.md
+docs/Model/ExtractTextResult.md
+docs/Model/ExtractTextResult.md
docs/Model/ResponseOpenAPIChatResult.md
docs/Model/ResponseOpenAPIChatResult.md
+docs/Model/ResponseOpenAPIExtractTextResult.md
+docs/Model/ResponseOpenAPIExtractTextResult.md
docs/Model/ResponseOpenAPITokensCountResult.md
docs/Model/ResponseOpenAPITokensCountResult.md
docs/Model/SpeechResult.md
@@ -36,8 +42,11 @@ lib/Configuration.php
lib/HeaderSelector.php
lib/Model/ChatParam.php
lib/Model/ChatResult.php
+lib/Model/ExtractTextParam.php
+lib/Model/ExtractTextResult.php
lib/Model/ModelInterface.php
lib/Model/ResponseOpenAPIChatResult.php
+lib/Model/ResponseOpenAPIExtractTextResult.php
lib/Model/ResponseOpenAPITokensCountResult.php
lib/Model/SpeechResult.php
lib/Model/StreamModule.php
@@ -52,7 +61,10 @@ phpunit.xml.dist
test/Api/AiApiTest.php
test/Model/ChatParamTest.php
test/Model/ChatResultTest.php
+test/Model/ExtractTextParamTest.php
+test/Model/ExtractTextResultTest.php
test/Model/ResponseOpenAPIChatResultTest.php
+test/Model/ResponseOpenAPIExtractTextResultTest.php
test/Model/ResponseOpenAPITokensCountResultTest.php
test/Model/SpeechResultTest.php
test/Model/StreamModuleTest.php
diff --git a/.openapi-generator/api-doc-php-sdk.sha256 b/.openapi-generator/api-doc-php-sdk.sha256
index 26698dd..b9c957b 100644
--- a/.openapi-generator/api-doc-php-sdk.sha256
+++ b/.openapi-generator/api-doc-php-sdk.sha256
@@ -1 +1 @@
-93328f7a4d67575a1c99daa92560bd0a39e5116d1e4eb8dd9cd149ca46040344
\ No newline at end of file
+8ddb52fb40c3511783f56cc9adf3407cbd17f68f1d980389999b4b0584c8e064
\ No newline at end of file
diff --git a/README.md b/README.md
index 5ef1c2a..7dd2af2 100644
--- a/README.md
+++ b/README.md
@@ -154,13 +154,17 @@ function example()
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AiApi* | [**chat**](docs/Api/AiApi.md#chat) | **POST** /v1/ai/chat | 元梦ai-对话
+*AiApi* | [**extractText**](docs/Api/AiApi.md#extracttext) | **POST** /v1/ai/extractText | 元梦ai-提取文件文本内容
*AiApi* | [**tokenCount**](docs/Api/AiApi.md#tokencount) | **POST** /v1/ai/tokenCount | 元梦ai-token统计
## 模型文档
- [ChatParam](docs/Model/ChatParam.md)
- [ChatResult](docs/Model/ChatResult.md)
+- [ExtractTextParam](docs/Model/ExtractTextParam.md)
+- [ExtractTextResult](docs/Model/ExtractTextResult.md)
- [ResponseOpenAPIChatResult](docs/Model/ResponseOpenAPIChatResult.md)
+- [ResponseOpenAPIExtractTextResult](docs/Model/ResponseOpenAPIExtractTextResult.md)
- [ResponseOpenAPITokensCountResult](docs/Model/ResponseOpenAPITokensCountResult.md)
- [SpeechResult](docs/Model/SpeechResult.md)
- [StreamModule](docs/Model/StreamModule.md)
diff --git a/composer.json b/composer.json
index 4f9a04d..612a8ac 100644
--- a/composer.json
+++ b/composer.json
@@ -1,5 +1,6 @@
{
"name": "tsl3060/low-carbon-platform",
+ "version": "1.1.2",
"description": "碳丝路数据开放平台",
"keywords": [
"openapitools",
diff --git a/docs/Api/AiApi.md b/docs/Api/AiApi.md
index c493e90..6bafd6d 100644
--- a/docs/Api/AiApi.md
+++ b/docs/Api/AiApi.md
@@ -3,6 +3,7 @@
| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**chat()**](AiApi.md#chat) | **POST** /v1/ai/chat | 元梦ai-对话 |
+| [**extractText()**](AiApi.md#extractText) | **POST** /v1/ai/extractText | 元梦ai-提取文件文本内容 |
| [**tokenCount()**](AiApi.md#tokenCount) | **POST** /v1/ai/tokenCount | 元梦ai-token统计 |
@@ -58,6 +59,62 @@ try {
[[返回模型列表]](../../README.md#模型文档)
[[返回README]](../../README.md)
+## `extractText()`
+
+```php
+extractText($file, $file2, $param): \OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult
+```
+
+元梦ai-提取文件文本内容
+
+提取上传文件的文本内容
+
+### 示例
+
+```php
+extractText($file, $file2, $param);
+ print_r($result);
+} catch (Exception $e) {
+ echo 'Exception when calling AiApi->extractText: ', $e->getMessage(), PHP_EOL;
+}
+```
+
+### 参数
+
+| Name | Type | Description | Notes |
+| ------------- | ------------- | ------------- | ------------- |
+| **file** | **\SplFileObject****\SplFileObject**| | |
+| **file2** | **\SplFileObject****\SplFileObject**| | [optional] |
+| **param** | [**\OpenAPI\Client\Model\ExtractTextParam**](../Model/ExtractTextParam.md)| | [optional] |
+
+### 返回类型
+
+[**\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult**](../Model/ResponseOpenAPIExtractTextResult.md)
+
+### HTTP请求头
+
+- **Content-Type**: `multipart/form-data`
+- **Accept**: `*/*`
+
+[[回到顶部]](#) [[返回API列表]](../../README.md#api端点文档)
+[[返回模型列表]](../../README.md#模型文档)
+[[返回README]](../../README.md)
+
## `tokenCount()`
```php
diff --git a/docs/Model/ExtractTextParam.md b/docs/Model/ExtractTextParam.md
new file mode 100644
index 0000000..9572ae9
--- /dev/null
+++ b/docs/Model/ExtractTextParam.md
@@ -0,0 +1,9 @@
+# # ExtractTextParam
+
+## 属性
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**extension** | **string** | 文件扩展名(可选值:ppt、pptx、doc、docx、xls、xlsx、pdf) |
+
+[[返回模型列表]](../../README.md#模型文档) [[返回API列表]](../../README.md#api端点文档) [[返回README]](../../README.md)
diff --git a/docs/Model/ExtractTextResult.md b/docs/Model/ExtractTextResult.md
new file mode 100644
index 0000000..0b32b2f
--- /dev/null
+++ b/docs/Model/ExtractTextResult.md
@@ -0,0 +1,9 @@
+# # ExtractTextResult
+
+## 属性
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**text** | **string** | 文本内容 | [optional]
+
+[[返回模型列表]](../../README.md#模型文档) [[返回API列表]](../../README.md#api端点文档) [[返回README]](../../README.md)
diff --git a/docs/Model/ResponseOpenAPIExtractTextResult.md b/docs/Model/ResponseOpenAPIExtractTextResult.md
new file mode 100644
index 0000000..9982513
--- /dev/null
+++ b/docs/Model/ResponseOpenAPIExtractTextResult.md
@@ -0,0 +1,20 @@
+# # ResponseOpenAPIExtractTextResult
+
+## 属性
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**time** | **string** | 该消息发生的时间 | [optional]
+**openid** | **string** | | [optional]
+**payload** | [**\OpenAPI\Client\Model\ExtractTextResult**](ExtractTextResult.md) | | [optional]
+**sign** | **string** | | [optional]
+**charset** | **string** | | [optional]
+**description** | **string** | | [optional]
+**response_id** | **string** | 消息的唯一ID | [optional]
+**err_code** | **int** | 该消息的错误码 | [optional]
+**err_msg** | **string** | 错误消息描述 | [optional]
+**sub_err** | **int** | 子错误的具体的代号 | [optional]
+**sub_msg** | **string** | 子错误对应的提示消息 | [optional]
+**sign_type** | **string** | | [optional]
+
+[[返回模型列表]](../../README.md#模型文档) [[返回API列表]](../../README.md#api端点文档) [[返回README]](../../README.md)
diff --git a/lib/Api/AiApi.php b/lib/Api/AiApi.php
index 06a54e9..bc4ef6e 100644
--- a/lib/Api/AiApi.php
+++ b/lib/Api/AiApi.php
@@ -81,6 +81,9 @@ class AiApi
'chat' => [
'application/json',
],
+ 'extractText' => [
+ 'multipart/form-data',
+ ],
'tokenCount' => [
'application/json',
],
@@ -419,7 +422,7 @@ class AiApi
$additionalParams['sign'] = $this->apiClient->requestSign($additionalParams);
// 根据Content-Type决定如何合并额外的参数
- if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ if (array_key_exists("Content-Type", $headers) && stripos($headers['Content-Type'], 'application/json') !== false) {
// 如果是application/json,将额外的参数合并到现有的JSON对象中
$existingParams = json_decode($httpBody, true);
if ($existingParams === null) {
@@ -427,7 +430,7 @@ class AiApi
}
$mergedParams = array_merge($existingParams, $additionalParams);
$httpBody = json_encode($mergedParams, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
- } else {
+ } else if(array_key_exists("Content-Type", $headers)){
// 如果不是application/json,将额外的参数合并到现有的查询字符串中
$existingParams = [];
if ($httpBody != null) {
@@ -458,6 +461,353 @@ class AiApi
);
}
+ /**
+ * Operation extractText
+ *
+ * 元梦ai-提取文件文本内容
+ *
+ * @param \SplFileObject $file file (required)
+ * @param \SplFileObject $file2 file2 (optional)
+ * @param \OpenAPI\Client\Model\ExtractTextParam $param param (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['extractText'] to see the possible values for this operation
+ *
+ * @throws \OpenAPI\Client\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return \OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult
+ */
+ public function extractText($file, $file2 = null, $param = null, string $contentType = self::contentTypes['extractText'][0])
+ {
+ list($response) = $this->extractTextWithHttpInfo($file, $file2, $param, $contentType);
+ return $response;
+ }
+
+ /**
+ * Operation extractTextWithHttpInfo
+ *
+ * 元梦ai-提取文件文本内容
+ *
+ * @param \SplFileObject $file (required)
+ * @param \SplFileObject $file2 (optional)
+ * @param \OpenAPI\Client\Model\ExtractTextParam $param (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['extractText'] to see the possible values for this operation
+ *
+ * @throws \OpenAPI\Client\ApiException on non-2xx response
+ * @throws \InvalidArgumentException
+ * @return array of \OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult, HTTP status code, HTTP response headers (array of strings)
+ */
+ public function extractTextWithHttpInfo($file, $file2 = null, $param = null, string $contentType = self::contentTypes['extractText'][0])
+ {
+ $request = $this->extractTextRequest($file, $file2, $param, $contentType);
+
+ try {
+ $options = $this->createHttpClientOption();
+ try {
+ $response = $this->client->send($request, $options);
+ } catch (RequestException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ $e->getResponse() ? $e->getResponse()->getHeaders() : null,
+ $e->getResponse() ? (string) $e->getResponse()->getBody() : null
+ );
+ } catch (ConnectException $e) {
+ throw new ApiException(
+ "[{$e->getCode()}] {$e->getMessage()}",
+ (int) $e->getCode(),
+ null,
+ null
+ );
+ }
+
+ // 响应预处理
+ $data = json_decode($response->getBody(), true);
+ if (json_last_error() !== JSON_ERROR_NONE) {
+ throw new ApiException("JSON解码错误: " . json_last_error_msg());
+ }
+
+ // 验证签名
+ if (!$this->apiClient->verifySign($data)) {
+ throw new ApiException(
+ 'Verification failed',
+ $response->getStatusCode(),
+ $response->getHeaders(),
+ $response->getBody()
+ );
+ }
+
+ $statusCode = $response->getStatusCode();
+
+ if ($statusCode < 200 || $statusCode > 299) {
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ (string) $request->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+
+ switch($statusCode) {
+ case 200:
+ if ('\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult' === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ('\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult' !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult', []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ }
+
+ $returnType = '\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult';
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+
+ } catch (ApiException $e) {
+ switch ($e->getCode()) {
+ case 200:
+ $data = ObjectSerializer::deserialize(
+ $e->getResponseBody(),
+ '\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult',
+ $e->getResponseHeaders()
+ );
+ $e->setResponseObject($data);
+ break;
+ }
+ throw $e;
+ }
+ }
+
+ /**
+ * Operation extractTextAsync
+ *
+ * 元梦ai-提取文件文本内容
+ *
+ * @param \SplFileObject $file (required)
+ * @param \SplFileObject $file2 (optional)
+ * @param \OpenAPI\Client\Model\ExtractTextParam $param (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['extractText'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function extractTextAsync($file, $file2 = null, $param = null, string $contentType = self::contentTypes['extractText'][0])
+ {
+ return $this->extractTextAsyncWithHttpInfo($file, $file2, $param, $contentType)
+ ->then(
+ function ($response) {
+ return $response[0];
+ }
+ );
+ }
+
+ /**
+ * Operation extractTextAsyncWithHttpInfo
+ *
+ * 元梦ai-提取文件文本内容
+ *
+ * @param \SplFileObject $file (required)
+ * @param \SplFileObject $file2 (optional)
+ * @param \OpenAPI\Client\Model\ExtractTextParam $param (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['extractText'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Promise\PromiseInterface
+ */
+ public function extractTextAsyncWithHttpInfo($file, $file2 = null, $param = null, string $contentType = self::contentTypes['extractText'][0])
+ {
+ $returnType = '\OpenAPI\Client\Model\ResponseOpenAPIExtractTextResult';
+ $request = $this->extractTextRequest($file, $file2, $param, $contentType);
+
+ return $this->client
+ ->sendAsync($request, $this->createHttpClientOption())
+ ->then(
+ function ($response) use ($returnType) {
+ if ($returnType === '\SplFileObject') {
+ $content = $response->getBody(); //stream goes to serializer
+ } else {
+ $content = (string) $response->getBody();
+ if ($returnType !== 'string') {
+ $content = json_decode($content);
+ }
+ }
+
+ return [
+ ObjectSerializer::deserialize($content, $returnType, []),
+ $response->getStatusCode(),
+ $response->getHeaders()
+ ];
+ },
+ function ($exception) {
+ $response = $exception->getResponse();
+ $statusCode = $response->getStatusCode();
+ throw new ApiException(
+ sprintf(
+ '[%d] Error connecting to the API (%s)',
+ $statusCode,
+ $exception->getRequest()->getUri()
+ ),
+ $statusCode,
+ $response->getHeaders(),
+ (string) $response->getBody()
+ );
+ }
+ );
+ }
+
+ /**
+ * Create request for operation 'extractText'
+ *
+ * @param \SplFileObject $file (required)
+ * @param \SplFileObject $file2 (optional)
+ * @param \OpenAPI\Client\Model\ExtractTextParam $param (optional)
+ * @param string $contentType The value for the Content-Type header. Check self::contentTypes['extractText'] to see the possible values for this operation
+ *
+ * @throws \InvalidArgumentException
+ * @return \GuzzleHttp\Psr7\Request
+ */
+ public function extractTextRequest($file, $file2 = null, $param = null, string $contentType = self::contentTypes['extractText'][0])
+ {
+
+ // verify the required parameter 'file' is set
+ if ($file === null || (is_array($file) && count($file) === 0)) {
+ throw new \InvalidArgumentException(
+ 'Missing the required parameter $file when calling extractText'
+ );
+ }
+
+
+
+
+ $resourcePath = '/v1/ai/extractText';
+ $formParams = [];
+ $queryParams = [];
+ $headerParams = [];
+ $httpBody = '';
+ $multipart = false;
+
+ // query params
+ $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
+ $file,
+ 'file', // param base name
+ 'string', // openApiType
+ 'form', // style
+ true, // explode
+ true // required
+ ) ?? []);
+
+
+
+ // form params
+ if ($file2 !== null) {
+ $multipart = true;
+ $formParams['file'] = [];
+ $paramFiles = is_array($file2) ? $file2 : [$file2];
+ foreach ($paramFiles as $paramFile) {
+ $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen(
+ ObjectSerializer::toFormValue($paramFile),
+ 'rb'
+ );
+ }
+ }
+ // form params
+ if ($param !== null) {
+ $formParams['param'] = ObjectSerializer::toFormValue($param);
+ }
+
+ $headers = $this->headerSelector->selectHeaders(
+ ['*/*', ],
+ $contentType,
+ $multipart
+ );
+
+ // for model (json/xml)
+ // 初始化额外的参数
+ $additionalParams = [
+ 'payload' => json_decode($httpBody, true),
+ 'path' => $resourcePath,
+ 'charset' => $this->config->getCharset(),
+ 'time' => date($this->config->getDataFormat(), time()),
+ 'sign_type' => $this->config->getSignType(),
+ 'access_token' => '',
+ 'app_id' => $this->config->getAppid(),
+ 'sign' => ''
+ ];
+
+ $additionalParams['sign'] = $this->apiClient->requestSign($additionalParams);
+
+ if (count($formParams) > 0) {
+ if ($multipart) {
+ $multipartContents = [];
+ foreach ($formParams as $formParamName => $formParamValue) {
+ $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];
+ foreach ($formParamValueItems as $formParamValueItem) {
+ $multipartContents[] = [
+ 'name' => $formParamName,
+ 'contents' => $formParamValueItem
+ ];
+ }
+ }
+ $multipartContents[] = [
+ 'name' => 'sign_param',
+ 'contents' => json_encode($additionalParams)
+ ];
+ // for HTTP post (form)
+ $httpBody = new MultipartStream($multipartContents);
+
+ } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {
+ # if Content-Type contains "application/json", json_encode the form parameters
+ $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams);
+ } else {
+ // for HTTP post (form)
+ $httpBody = ObjectSerializer::buildQuery($formParams);
+ }
+ }
+
+
+
+ $defaultHeaders = [];
+ if ($this->config->getUserAgent()) {
+ $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
+ }
+
+ $headers = array_merge(
+ $defaultHeaders,
+ $headerParams,
+ $headers
+ );
+
+ $operationHost = $this->config->getHost();
+ $query = ObjectSerializer::buildQuery($queryParams);
+ return new Request(
+ 'POST',
+ $operationHost . $resourcePath . ($query ? "?{$query}" : ''),
+ $headers,
+ $httpBody
+ );
+ }
+
/**
* Operation tokenCount
*
@@ -744,7 +1094,7 @@ class AiApi
$additionalParams['sign'] = $this->apiClient->requestSign($additionalParams);
// 根据Content-Type决定如何合并额外的参数
- if (stripos($headers['Content-Type'], 'application/json') !== false) {
+ if (array_key_exists("Content-Type", $headers) && stripos($headers['Content-Type'], 'application/json') !== false) {
// 如果是application/json,将额外的参数合并到现有的JSON对象中
$existingParams = json_decode($httpBody, true);
if ($existingParams === null) {
@@ -752,7 +1102,7 @@ class AiApi
}
$mergedParams = array_merge($existingParams, $additionalParams);
$httpBody = json_encode($mergedParams, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
- } else {
+ } else if(array_key_exists("Content-Type", $headers)){
// 如果不是application/json,将额外的参数合并到现有的查询字符串中
$existingParams = [];
if ($httpBody != null) {
diff --git a/lib/Model/ExtractTextParam.php b/lib/Model/ExtractTextParam.php
new file mode 100644
index 0000000..966c908
--- /dev/null
+++ b/lib/Model/ExtractTextParam.php
@@ -0,0 +1,413 @@
+
+ */
+class ExtractTextParam implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ExtractTextParam';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'extension' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'extension' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'extension' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'extension' => 'extension'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'extension' => 'setExtension'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'extension' => 'getExtension'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('extension', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ if ($this->container['extension'] === null) {
+ $invalidProperties[] = "'extension' can't be null";
+ }
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets extension
+ *
+ * @return string
+ */
+ public function getExtension()
+ {
+ return $this->container['extension'];
+ }
+
+ /**
+ * Sets extension
+ *
+ * @param string $extension 文件扩展名(可选值:ppt、pptx、doc、docx、xls、xlsx、pdf)
+ *
+ * @return self
+ */
+ public function setExtension($extension)
+ {
+ if (is_null($extension)) {
+ throw new \InvalidArgumentException('non-nullable extension cannot be null');
+ }
+ $this->container['extension'] = $extension;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ExtractTextResult.php b/lib/Model/ExtractTextResult.php
new file mode 100644
index 0000000..0b8292e
--- /dev/null
+++ b/lib/Model/ExtractTextResult.php
@@ -0,0 +1,410 @@
+
+ */
+class ExtractTextResult implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ExtractTextResult';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'text' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'text' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'text' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'text' => 'text'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'text' => 'setText'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'text' => 'getText'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('text', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets text
+ *
+ * @return string|null
+ */
+ public function getText()
+ {
+ return $this->container['text'];
+ }
+
+ /**
+ * Sets text
+ *
+ * @param string|null $text 文本内容
+ *
+ * @return self
+ */
+ public function setText($text)
+ {
+ if (is_null($text)) {
+ throw new \InvalidArgumentException('non-nullable text cannot be null');
+ }
+ $this->container['text'] = $text;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/lib/Model/ResponseOpenAPIExtractTextResult.php b/lib/Model/ResponseOpenAPIExtractTextResult.php
new file mode 100644
index 0000000..a86f705
--- /dev/null
+++ b/lib/Model/ResponseOpenAPIExtractTextResult.php
@@ -0,0 +1,784 @@
+
+ */
+class ResponseOpenAPIExtractTextResult implements ModelInterface, ArrayAccess, \JsonSerializable
+{
+ public const DISCRIMINATOR = null;
+
+ /**
+ * The original name of the model.
+ *
+ * @var string
+ */
+ protected static $openAPIModelName = 'ResponseOpenAPIExtractTextResult';
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @var string[]
+ */
+ protected static $openAPITypes = [
+ 'time' => 'string',
+ 'openid' => 'string',
+ 'payload' => '\OpenAPI\Client\Model\ExtractTextResult',
+ 'sign' => 'string',
+ 'charset' => 'string',
+ 'description' => 'string',
+ 'response_id' => 'string',
+ 'err_code' => 'int',
+ 'err_msg' => 'string',
+ 'sub_err' => 'int',
+ 'sub_msg' => 'string',
+ 'sign_type' => 'string'
+ ];
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @var string[]
+ * @phpstan-var array
+ * @psalm-var array
+ */
+ protected static $openAPIFormats = [
+ 'time' => null,
+ 'openid' => null,
+ 'payload' => null,
+ 'sign' => null,
+ 'charset' => null,
+ 'description' => null,
+ 'response_id' => null,
+ 'err_code' => 'int32',
+ 'err_msg' => null,
+ 'sub_err' => 'int32',
+ 'sub_msg' => null,
+ 'sign_type' => null
+ ];
+
+ /**
+ * Array of nullable properties. Used for (de)serialization
+ *
+ * @var boolean[]
+ */
+ protected static array $openAPINullables = [
+ 'time' => false,
+ 'openid' => false,
+ 'payload' => false,
+ 'sign' => false,
+ 'charset' => false,
+ 'description' => false,
+ 'response_id' => false,
+ 'err_code' => false,
+ 'err_msg' => false,
+ 'sub_err' => false,
+ 'sub_msg' => false,
+ 'sign_type' => false
+ ];
+
+ /**
+ * If a nullable field gets set to null, insert it here
+ *
+ * @var boolean[]
+ */
+ protected array $openAPINullablesSetToNull = [];
+
+ /**
+ * Array of property to type mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPITypes()
+ {
+ return self::$openAPITypes;
+ }
+
+ /**
+ * Array of property to format mappings. Used for (de)serialization
+ *
+ * @return array
+ */
+ public static function openAPIFormats()
+ {
+ return self::$openAPIFormats;
+ }
+
+ /**
+ * Array of nullable properties
+ *
+ * @return array
+ */
+ protected static function openAPINullables(): array
+ {
+ return self::$openAPINullables;
+ }
+
+ /**
+ * Array of nullable field names deliberately set to null
+ *
+ * @return boolean[]
+ */
+ private function getOpenAPINullablesSetToNull(): array
+ {
+ return $this->openAPINullablesSetToNull;
+ }
+
+ /**
+ * Setter - Array of nullable field names deliberately set to null
+ *
+ * @param boolean[] $openAPINullablesSetToNull
+ */
+ private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void
+ {
+ $this->openAPINullablesSetToNull = $openAPINullablesSetToNull;
+ }
+
+ /**
+ * Checks if a property is nullable
+ *
+ * @param string $property
+ * @return bool
+ */
+ public static function isNullable(string $property): bool
+ {
+ return self::openAPINullables()[$property] ?? false;
+ }
+
+ /**
+ * Checks if a nullable property is set to null.
+ *
+ * @param string $property
+ * @return bool
+ */
+ public function isNullableSetToNull(string $property): bool
+ {
+ return in_array($property, $this->getOpenAPINullablesSetToNull(), true);
+ }
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @var string[]
+ */
+ protected static $attributeMap = [
+ 'time' => 'time',
+ 'openid' => 'openid',
+ 'payload' => 'payload',
+ 'sign' => 'sign',
+ 'charset' => 'charset',
+ 'description' => 'description',
+ 'response_id' => 'response_id',
+ 'err_code' => 'err_code',
+ 'err_msg' => 'err_msg',
+ 'sub_err' => 'sub_err',
+ 'sub_msg' => 'sub_msg',
+ 'sign_type' => 'sign_type'
+ ];
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @var string[]
+ */
+ protected static $setters = [
+ 'time' => 'setTime',
+ 'openid' => 'setOpenid',
+ 'payload' => 'setPayload',
+ 'sign' => 'setSign',
+ 'charset' => 'setCharset',
+ 'description' => 'setDescription',
+ 'response_id' => 'setResponseId',
+ 'err_code' => 'setErrCode',
+ 'err_msg' => 'setErrMsg',
+ 'sub_err' => 'setSubErr',
+ 'sub_msg' => 'setSubMsg',
+ 'sign_type' => 'setSignType'
+ ];
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @var string[]
+ */
+ protected static $getters = [
+ 'time' => 'getTime',
+ 'openid' => 'getOpenid',
+ 'payload' => 'getPayload',
+ 'sign' => 'getSign',
+ 'charset' => 'getCharset',
+ 'description' => 'getDescription',
+ 'response_id' => 'getResponseId',
+ 'err_code' => 'getErrCode',
+ 'err_msg' => 'getErrMsg',
+ 'sub_err' => 'getSubErr',
+ 'sub_msg' => 'getSubMsg',
+ 'sign_type' => 'getSignType'
+ ];
+
+ /**
+ * Array of attributes where the key is the local name,
+ * and the value is the original name
+ *
+ * @return array
+ */
+ public static function attributeMap()
+ {
+ return self::$attributeMap;
+ }
+
+ /**
+ * Array of attributes to setter functions (for deserialization of responses)
+ *
+ * @return array
+ */
+ public static function setters()
+ {
+ return self::$setters;
+ }
+
+ /**
+ * Array of attributes to getter functions (for serialization of requests)
+ *
+ * @return array
+ */
+ public static function getters()
+ {
+ return self::$getters;
+ }
+
+ /**
+ * The original name of the model.
+ *
+ * @return string
+ */
+ public function getModelName()
+ {
+ return self::$openAPIModelName;
+ }
+
+
+ /**
+ * Associative array for storing property values
+ *
+ * @var mixed[]
+ */
+ protected $container = [];
+
+ /**
+ * Constructor
+ *
+ * @param mixed[] $data Associated array of property values
+ * initializing the model
+ */
+ public function __construct(array $data = null)
+ {
+ $this->setIfExists('time', $data ?? [], null);
+ $this->setIfExists('openid', $data ?? [], null);
+ $this->setIfExists('payload', $data ?? [], null);
+ $this->setIfExists('sign', $data ?? [], null);
+ $this->setIfExists('charset', $data ?? [], null);
+ $this->setIfExists('description', $data ?? [], null);
+ $this->setIfExists('response_id', $data ?? [], null);
+ $this->setIfExists('err_code', $data ?? [], null);
+ $this->setIfExists('err_msg', $data ?? [], null);
+ $this->setIfExists('sub_err', $data ?? [], null);
+ $this->setIfExists('sub_msg', $data ?? [], null);
+ $this->setIfExists('sign_type', $data ?? [], null);
+ }
+
+ /**
+ * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName
+ * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the
+ * $this->openAPINullablesSetToNull array
+ *
+ * @param string $variableName
+ * @param array $fields
+ * @param mixed $defaultValue
+ */
+ private function setIfExists(string $variableName, array $fields, $defaultValue): void
+ {
+ if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) {
+ $this->openAPINullablesSetToNull[] = $variableName;
+ }
+
+ $this->container[$variableName] = $fields[$variableName] ?? $defaultValue;
+ }
+
+ /**
+ * Show all the invalid properties with reasons.
+ *
+ * @return array invalid properties with reasons
+ */
+ public function listInvalidProperties()
+ {
+ $invalidProperties = [];
+
+ return $invalidProperties;
+ }
+
+ /**
+ * Validate all the properties in the model
+ * return true if all passed
+ *
+ * @return bool True if all properties are valid
+ */
+ public function valid()
+ {
+ return count($this->listInvalidProperties()) === 0;
+ }
+
+
+ /**
+ * Gets time
+ *
+ * @return string|null
+ */
+ public function getTime()
+ {
+ return $this->container['time'];
+ }
+
+ /**
+ * Sets time
+ *
+ * @param string|null $time 该消息发生的时间
+ *
+ * @return self
+ */
+ public function setTime($time)
+ {
+ if (is_null($time)) {
+ throw new \InvalidArgumentException('non-nullable time cannot be null');
+ }
+ $this->container['time'] = $time;
+
+ return $this;
+ }
+
+ /**
+ * Gets openid
+ *
+ * @return string|null
+ */
+ public function getOpenid()
+ {
+ return $this->container['openid'];
+ }
+
+ /**
+ * Sets openid
+ *
+ * @param string|null $openid openid
+ *
+ * @return self
+ */
+ public function setOpenid($openid)
+ {
+ if (is_null($openid)) {
+ throw new \InvalidArgumentException('non-nullable openid cannot be null');
+ }
+ $this->container['openid'] = $openid;
+
+ return $this;
+ }
+
+ /**
+ * Gets payload
+ *
+ * @return \OpenAPI\Client\Model\ExtractTextResult|null
+ */
+ public function getPayload()
+ {
+ return $this->container['payload'];
+ }
+
+ /**
+ * Sets payload
+ *
+ * @param \OpenAPI\Client\Model\ExtractTextResult|null $payload payload
+ *
+ * @return self
+ */
+ public function setPayload($payload)
+ {
+ if (is_null($payload)) {
+ throw new \InvalidArgumentException('non-nullable payload cannot be null');
+ }
+ $this->container['payload'] = $payload;
+
+ return $this;
+ }
+
+ /**
+ * Gets sign
+ *
+ * @return string|null
+ */
+ public function getSign()
+ {
+ return $this->container['sign'];
+ }
+
+ /**
+ * Sets sign
+ *
+ * @param string|null $sign sign
+ *
+ * @return self
+ */
+ public function setSign($sign)
+ {
+ if (is_null($sign)) {
+ throw new \InvalidArgumentException('non-nullable sign cannot be null');
+ }
+ $this->container['sign'] = $sign;
+
+ return $this;
+ }
+
+ /**
+ * Gets charset
+ *
+ * @return string|null
+ */
+ public function getCharset()
+ {
+ return $this->container['charset'];
+ }
+
+ /**
+ * Sets charset
+ *
+ * @param string|null $charset charset
+ *
+ * @return self
+ */
+ public function setCharset($charset)
+ {
+ if (is_null($charset)) {
+ throw new \InvalidArgumentException('non-nullable charset cannot be null');
+ }
+ $this->container['charset'] = $charset;
+
+ return $this;
+ }
+
+ /**
+ * Gets description
+ *
+ * @return string|null
+ */
+ public function getDescription()
+ {
+ return $this->container['description'];
+ }
+
+ /**
+ * Sets description
+ *
+ * @param string|null $description description
+ *
+ * @return self
+ */
+ public function setDescription($description)
+ {
+ if (is_null($description)) {
+ throw new \InvalidArgumentException('non-nullable description cannot be null');
+ }
+ $this->container['description'] = $description;
+
+ return $this;
+ }
+
+ /**
+ * Gets response_id
+ *
+ * @return string|null
+ */
+ public function getResponseId()
+ {
+ return $this->container['response_id'];
+ }
+
+ /**
+ * Sets response_id
+ *
+ * @param string|null $response_id 消息的唯一ID
+ *
+ * @return self
+ */
+ public function setResponseId($response_id)
+ {
+ if (is_null($response_id)) {
+ throw new \InvalidArgumentException('non-nullable response_id cannot be null');
+ }
+ $this->container['response_id'] = $response_id;
+
+ return $this;
+ }
+
+ /**
+ * Gets err_code
+ *
+ * @return int|null
+ */
+ public function getErrCode()
+ {
+ return $this->container['err_code'];
+ }
+
+ /**
+ * Sets err_code
+ *
+ * @param int|null $err_code 该消息的错误码
+ *
+ * @return self
+ */
+ public function setErrCode($err_code)
+ {
+ if (is_null($err_code)) {
+ throw new \InvalidArgumentException('non-nullable err_code cannot be null');
+ }
+ $this->container['err_code'] = $err_code;
+
+ return $this;
+ }
+
+ /**
+ * Gets err_msg
+ *
+ * @return string|null
+ */
+ public function getErrMsg()
+ {
+ return $this->container['err_msg'];
+ }
+
+ /**
+ * Sets err_msg
+ *
+ * @param string|null $err_msg 错误消息描述
+ *
+ * @return self
+ */
+ public function setErrMsg($err_msg)
+ {
+ if (is_null($err_msg)) {
+ throw new \InvalidArgumentException('non-nullable err_msg cannot be null');
+ }
+ $this->container['err_msg'] = $err_msg;
+
+ return $this;
+ }
+
+ /**
+ * Gets sub_err
+ *
+ * @return int|null
+ */
+ public function getSubErr()
+ {
+ return $this->container['sub_err'];
+ }
+
+ /**
+ * Sets sub_err
+ *
+ * @param int|null $sub_err 子错误的具体的代号
+ *
+ * @return self
+ */
+ public function setSubErr($sub_err)
+ {
+ if (is_null($sub_err)) {
+ throw new \InvalidArgumentException('non-nullable sub_err cannot be null');
+ }
+ $this->container['sub_err'] = $sub_err;
+
+ return $this;
+ }
+
+ /**
+ * Gets sub_msg
+ *
+ * @return string|null
+ */
+ public function getSubMsg()
+ {
+ return $this->container['sub_msg'];
+ }
+
+ /**
+ * Sets sub_msg
+ *
+ * @param string|null $sub_msg 子错误对应的提示消息
+ *
+ * @return self
+ */
+ public function setSubMsg($sub_msg)
+ {
+ if (is_null($sub_msg)) {
+ throw new \InvalidArgumentException('non-nullable sub_msg cannot be null');
+ }
+ $this->container['sub_msg'] = $sub_msg;
+
+ return $this;
+ }
+
+ /**
+ * Gets sign_type
+ *
+ * @return string|null
+ */
+ public function getSignType()
+ {
+ return $this->container['sign_type'];
+ }
+
+ /**
+ * Sets sign_type
+ *
+ * @param string|null $sign_type sign_type
+ *
+ * @return self
+ */
+ public function setSignType($sign_type)
+ {
+ if (is_null($sign_type)) {
+ throw new \InvalidArgumentException('non-nullable sign_type cannot be null');
+ }
+ $this->container['sign_type'] = $sign_type;
+
+ return $this;
+ }
+ /**
+ * Returns true if offset exists. False otherwise.
+ *
+ * @param integer $offset Offset
+ *
+ * @return boolean
+ */
+ public function offsetExists($offset): bool
+ {
+ return isset($this->container[$offset]);
+ }
+
+ /**
+ * Gets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return mixed|null
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->container[$offset] ?? null;
+ }
+
+ /**
+ * Sets value based on offset.
+ *
+ * @param int|null $offset Offset
+ * @param mixed $value Value to be set
+ *
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ if (is_null($offset)) {
+ $this->container[] = $value;
+ } else {
+ $this->container[$offset] = $value;
+ }
+ }
+
+ /**
+ * Unsets offset.
+ *
+ * @param integer $offset Offset
+ *
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ unset($this->container[$offset]);
+ }
+
+ /**
+ * Serializes the object to a value that can be serialized natively by json_encode().
+ * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php
+ *
+ * @return mixed Returns data which can be serialized by json_encode(), which is a value
+ * of any type other than a resource.
+ */
+ #[\ReturnTypeWillChange]
+ public function jsonSerialize()
+ {
+ return ObjectSerializer::sanitizeForSerialization($this);
+ }
+
+ /**
+ * Gets the string presentation of the object
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return json_encode(
+ ObjectSerializer::sanitizeForSerialization($this),
+ JSON_PRETTY_PRINT
+ );
+ }
+
+ /**
+ * Gets a header-safe presentation of the object
+ *
+ * @return string
+ */
+ public function toHeaderValue()
+ {
+ return json_encode(ObjectSerializer::sanitizeForSerialization($this));
+ }
+}
+
+
diff --git a/test/Api/AiApiTest.php b/test/Api/AiApiTest.php
index bdbe50b..8b639a5 100644
--- a/test/Api/AiApiTest.php
+++ b/test/Api/AiApiTest.php
@@ -83,6 +83,18 @@ class AiApiTest extends TestCase
$this->markTestIncomplete('Not implemented');
}
+ /**
+ * Test case for extractText
+ *
+ * 元梦ai-提取文件文本内容.
+ *
+ */
+ public function testExtractText()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
/**
* Test case for tokenCount
*
diff --git a/test/Model/ExtractTextParamTest.php b/test/Model/ExtractTextParamTest.php
new file mode 100644
index 0000000..53d202f
--- /dev/null
+++ b/test/Model/ExtractTextParamTest.php
@@ -0,0 +1,90 @@
+markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "extension"
+ */
+ public function testPropertyExtension()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+}
diff --git a/test/Model/ExtractTextResultTest.php b/test/Model/ExtractTextResultTest.php
new file mode 100644
index 0000000..adcadc4
--- /dev/null
+++ b/test/Model/ExtractTextResultTest.php
@@ -0,0 +1,90 @@
+markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "text"
+ */
+ public function testPropertyText()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+}
diff --git a/test/Model/ResponseOpenAPIExtractTextResultTest.php b/test/Model/ResponseOpenAPIExtractTextResultTest.php
new file mode 100644
index 0000000..f27a83a
--- /dev/null
+++ b/test/Model/ResponseOpenAPIExtractTextResultTest.php
@@ -0,0 +1,189 @@
+markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "time"
+ */
+ public function testPropertyTime()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "openid"
+ */
+ public function testPropertyOpenid()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "payload"
+ */
+ public function testPropertyPayload()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "sign"
+ */
+ public function testPropertySign()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "charset"
+ */
+ public function testPropertyCharset()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "description"
+ */
+ public function testPropertyDescription()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "response_id"
+ */
+ public function testPropertyResponseId()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "err_code"
+ */
+ public function testPropertyErrCode()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "err_msg"
+ */
+ public function testPropertyErrMsg()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "sub_err"
+ */
+ public function testPropertySubErr()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "sub_msg"
+ */
+ public function testPropertySubMsg()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+
+ /**
+ * Test attribute "sign_type"
+ */
+ public function testPropertySignType()
+ {
+ // TODO: implement
+ $this->markTestIncomplete('Not implemented');
+ }
+}