DocumentModelAdministrationClient class
用來與窗體辨識器服務模型管理功能互動的用戶端,例如建立、讀取、清單、刪除和複製模型。
例子:
Azure Active Directory
import { DocumentModelAdministrationClient } from "@azure/ai-form-recognizer";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new DefaultAzureCredential();
const client = new DocumentModelAdministrationClient(endpoint, credential);
API 金鑰 (訂用帳戶金鑰)
import { DocumentModelAdministrationClient, AzureKeyCredential } from "@azure/ai-form-recognizer";
const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new AzureKeyCredential("<api key>");
const client = new DocumentModelAdministrationClient(endpoint, credential);
建構函式
Document |
從資源端點和靜態 API 金鑰建立 DocumentModelAdministrationClient 實例( 例:
|
Document |
從資源端點和 Azure 身分識別 如需使用 Azure Active Directory 進行驗證的詳細資訊,請參閱 例:
|
方法
begin |
使用指定的分類器識別碼和檔類型來建置新的檔案分類器。 分類器標識碼在資源內的分類器中必須是唯一的。 檔案類型會以物件的形式提供,將檔類型的名稱對應至該文件類型的定型數據集。 支援兩種定型資料輸入法:
表單辨識器服務會從 Azure 記憶體容器讀取定型數據集,此數據集會以 SAS 令牌作為容器的 URL,讓服務後端能夠與容器通訊。 至少需要「讀取」和「清單」許可權。 此外,必須根據特定慣例來組織指定容器中的數據,該慣例記載於服務的檔 ,以建置自定義檔分類器。 例
|
begin |
從模型內容來源建置具有指定標識元的新模型。 模型標識符可以包含任何文字,只要它不是以 「prebuilt-」 開頭(因為這些模型是指所有資源通用的預先建置表單辨識器模型),只要它不存在於資源內即可。 內容來源描述服務將用來讀取輸入定型數據的機制。 如需詳細資訊,請參閱 <xref:DocumentModelContentSource> 類型。 例
|
begin |
從一組輸入檔和加上標籤的欄位,建置具有指定標識元的新模型。 模型標識符可以包含任何文字,只要它不是以 「prebuilt-」 開頭(因為這些模型是指所有資源通用的預先建置表單辨識器模型),只要它不存在於資源內即可。 表單辨識器服務會從 Azure 記憶體容器讀取定型數據集,此數據集會以 SAS 令牌作為容器的 URL,讓服務後端能夠與容器通訊。 至少需要「讀取」和「清單」許可權。 此外,指定容器中的數據必須根據特定慣例來組織,此慣例記載於服務的檔 建置自定義模型。 例
|
begin |
從數個預先存在的子模型建立單一撰寫模型。 產生的組成模型會結合其元件模型的檔類型,並將分類步驟插入擷取管線,以判斷哪一個元件子模型最適合指定的輸入。 例
|
begin |
將具有指定標識碼的模型複製到由指定複製授權編碼的資源和模型標識碼。 請參閱 CopyAuthorization 和 getCopyAuthorization。 例
|
delete |
如果存在,則會從客戶端資源中刪除具有指定標識碼的分類器。 無法還原此作業。 例
|
delete |
如果模型存在,則會從客戶端的資源中刪除具有指定標識符的模型。 無法還原此作業。 例
|
get |
建立授權,將模型複製到與
例
|
get |
依標識符擷取分類器的相關信息(DocumentClassifierDetails)。 例
|
get |
依標識符擷取模型的相關信息(DocumentModelDetails)。 這個方法可以擷取自定義和預先建置模型的相關信息。 重大變更在舊版的窗體辨識器 REST API 和 SDK 中, 例
|
get |
依作業標識符擷取作業的相關信息( 作業代表非分析工作,例如建置、撰寫或複製模型。 |
get |
擷取此客戶端資源的基本資訊。 例
|
list |
列出資源中分類器的詳細數據。 此作業支援分頁。 例子異步反覆運算
依頁面
|
list |
列出資源中的模型摘要。 將包含自定義和預先建置的模型。 此作業支援分頁。 模型摘要(DocumentModelSummary)只包含模型的基本資訊,而且不包含模型中檔類型的相關信息(例如字段架構和信賴值)。 若要存取模型的完整資訊,請使用 getDocumentModel。 重大變更在舊版的窗體辨識器 REST API 和 SDK 中, 例子異步反覆運算
依頁面
|
list |
列出資源中的模型建立作業。 這會產生所有作業,包括無法成功建立模型的作業。 此作業支援分頁。 例子異步反覆運算
依頁面
|
建構函式詳細資料
DocumentModelAdministrationClient(string, KeyCredential, DocumentModelAdministrationClientOptions)
從資源端點和靜態 API 金鑰建立 DocumentModelAdministrationClient 實例(KeyCredential
),
例:
import { DocumentModelAdministrationClient, AzureKeyCredential } from "@azure/ai-form-recognizer";
const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new AzureKeyCredential("<api key>");
const client = new DocumentModelAdministrationClient(endpoint, credential);
new DocumentModelAdministrationClient(endpoint: string, credential: KeyCredential, options?: DocumentModelAdministrationClientOptions)
參數
- endpoint
-
string
Azure 認知服務實例的端點 URL
- credential
- KeyCredential
包含認知服務實例訂用帳戶密鑰的 KeyCredential
在客戶端中設定所有方法的選擇性設定
DocumentModelAdministrationClient(string, TokenCredential, DocumentModelAdministrationClientOptions)
從資源端點和 Azure 身分識別 TokenCredential
建立 DocumentModelAdministrationClient 實例。
如需使用 Azure Active Directory 進行驗證的詳細資訊,請參閱 @azure/identity
套件。
例:
import { DocumentModelAdministrationClient } from "@azure/ai-form-recognizer";
import { DefaultAzureCredential } from "@azure/identity";
const endpoint = "https://<resource name>.cognitiveservices.azure.com";
const credential = new DefaultAzureCredential();
const client = new DocumentModelAdministrationClient(endpoint, credential);
new DocumentModelAdministrationClient(endpoint: string, credential: TokenCredential, options?: DocumentModelAdministrationClientOptions)
參數
- endpoint
-
string
Azure 認知服務實例的端點 URL
- credential
- TokenCredential
來自 @azure/identity
套件的 TokenCredential 實例
在客戶端中設定所有方法的選擇性設定
方法詳細資料
beginBuildDocumentClassifier(string, DocumentClassifierDocumentTypeSources, BeginBuildDocumentClassifierOptions)
使用指定的分類器識別碼和檔類型來建置新的檔案分類器。
分類器標識碼在資源內的分類器中必須是唯一的。
檔案類型會以物件的形式提供,將檔類型的名稱對應至該文件類型的定型數據集。 支援兩種定型資料輸入法:
-
azureBlobSource
,它會使用指定 Azure Blob 記憶體容器中的數據來訓練分類器。 -
azureBlobFileListSource
,這類似於azureBlobSource
,但允許使用 JSONL 格式的檔案清單,更精細地控制定型數據集中包含的檔案。
表單辨識器服務會從 Azure 記憶體容器讀取定型數據集,此數據集會以 SAS 令牌作為容器的 URL,讓服務後端能夠與容器通訊。 至少需要「讀取」和「清單」許可權。 此外,必須根據特定慣例來組織指定容器中的數據,該慣例記載於服務的檔 ,以建置自定義檔分類器。
例
const classifierId = "aNewClassifier";
const containerUrl1 = "<training data container SAS URL 1>";
const containerUrl2 = "<training data container SAS URL 2>";
const poller = await client.beginBuildDocumentClassifier(
classifierId,
{
// The document types. Each entry in this object should map a document type name to a
// `ClassifierDocumentTypeDetails` object
"formX": {
azureBlobSource: {
containerUrl: containerUrl1,
}
},
"formY": {
azureBlobFileListSource: {
containerUrl: containerUrl2,
fileList: "path/to/fileList.jsonl"
}
},
},
{
// Optionally, a text description may be attached to the classifier
description: "This is an example classifier!"
}
);
// Classifier building, like model creation operations, returns a poller that eventually produces a
// DocumentClassifierDetails object
const classifierDetails = await poller.pollUntilDone();
const {
classifierId, // identical to the classifierId given when creating the classifier
description, // identical to the description given when creating the classifier (if any)
createdOn, // the Date (timestamp) that the classifier was created
docTypes // information about the document types in the classifier and their details
} = classifierDetails;
function beginBuildDocumentClassifier(classifierId: string, docTypeSources: DocumentClassifierDocumentTypeSources, options?: BeginBuildDocumentClassifierOptions): Promise<DocumentClassifierPoller>
參數
- classifierId
-
string
要建立之分類器的唯一標識符
- docTypeSources
- DocumentClassifierDocumentTypeSources
要包含在分類器及其來源中的檔案類型(檔案類型名稱對應至 ClassifierDocumentTypeDetails
)
分類器建置作業的選擇性設定
傳回
Promise<DocumentClassifierPoller>
長時間執行的作業 (poller) 最終會產生已建立的分類器詳細數據或錯誤
beginBuildDocumentModel(string, DocumentModelSource, DocumentModelBuildMode, BeginBuildDocumentModelOptions)
從模型內容來源建置具有指定標識元的新模型。
模型標識符可以包含任何文字,只要它不是以 「prebuilt-」 開頭(因為這些模型是指所有資源通用的預先建置表單辨識器模型),只要它不存在於資源內即可。
內容來源描述服務將用來讀取輸入定型數據的機制。 如需詳細資訊,請參閱 <xref:DocumentModelContentSource> 類型。
例
const modelId = "aNewModel";
const poller = await client.beginBuildDocumentModel(modelId, { containerUrl: "<SAS-encoded blob container URL>" }, {
// Optionally, a text description may be attached to the model
description: "This is an example model!"
});
// Model building, like all other model creation operations, returns a poller that eventually produces a ModelDetails
// object
const modelDetails = await poller.pollUntilDone();
const {
modelId, // identical to the modelId given when creating the model
description, // identical to the description given when creating the model
createdOn, // the Date (timestamp) that the model was created
docTypes // information about the document types in the model and their field schemas
} = modelDetails;
function beginBuildDocumentModel(modelId: string, contentSource: DocumentModelSource, buildMode: DocumentModelBuildMode, options?: BeginBuildDocumentModelOptions): Promise<DocumentModelPoller>
參數
- modelId
-
string
要建立之模型的唯一標識碼
- contentSource
- DocumentModelSource
提供此模型定型數據的內容來源
- buildMode
-
DocumentModelBuildMode
建置模型時要使用的模式(請參閱 DocumentModelBuildMode
)
- options
- BeginBuildDocumentModelOptions
模型建置作業的選擇性設定
傳回
Promise<DocumentModelPoller>
長時間執行的作業 (poller) 最終會產生已建立的模型資訊或錯誤
beginBuildDocumentModel(string, string, DocumentModelBuildMode, BeginBuildDocumentModelOptions)
從一組輸入檔和加上標籤的欄位,建置具有指定標識元的新模型。
模型標識符可以包含任何文字,只要它不是以 「prebuilt-」 開頭(因為這些模型是指所有資源通用的預先建置表單辨識器模型),只要它不存在於資源內即可。
表單辨識器服務會從 Azure 記憶體容器讀取定型數據集,此數據集會以 SAS 令牌作為容器的 URL,讓服務後端能夠與容器通訊。 至少需要「讀取」和「清單」許可權。 此外,指定容器中的數據必須根據特定慣例來組織,此慣例記載於服務的檔 建置自定義模型。
例
const modelId = "aNewModel";
const containerUrl = "<training data container SAS URL>";
const poller = await client.beginBuildDocumentModel(modelId, containerUrl, {
// Optionally, a text description may be attached to the model
description: "This is an example model!"
});
// Model building, like all other model creation operations, returns a poller that eventually produces a ModelDetails
// object
const modelDetails = await poller.pollUntilDone();
const {
modelId, // identical to the modelId given when creating the model
description, // identical to the description given when creating the model
createdOn, // the Date (timestamp) that the model was created
docTypes // information about the document types in the model and their field schemas
} = modelDetails;
function beginBuildDocumentModel(modelId: string, containerUrl: string, buildMode: DocumentModelBuildMode, options?: BeginBuildDocumentModelOptions): Promise<DocumentModelPoller>
參數
- modelId
-
string
要建立之模型的唯一標識碼
- containerUrl
-
string
保存定型數據集的 Azure 記憶體容器 SAS 編碼 URL
- buildMode
-
DocumentModelBuildMode
建置模型時要使用的模式(請參閱 DocumentModelBuildMode
)
- options
- BeginBuildDocumentModelOptions
模型建置作業的選擇性設定
傳回
Promise<DocumentModelPoller>
長時間執行的作業 (poller) 最終會產生已建立的模型資訊或錯誤
beginComposeDocumentModel(string, Iterable<string>, BeginComposeDocumentModelOptions)
從數個預先存在的子模型建立單一撰寫模型。
產生的組成模型會結合其元件模型的檔類型,並將分類步驟插入擷取管線,以判斷哪一個元件子模型最適合指定的輸入。
例
const modelId = "aNewComposedModel";
const subModelIds = [
"documentType1Model",
"documentType2Model",
"documentType3Model"
];
// The resulting composed model can classify and extract data from documents
// conforming to any of the above document types
const poller = await client.beginComposeDocumentModel(modelId, subModelIds, {
description: "This is a composed model that can handle several document types."
});
// Model composition, like all other model creation operations, returns a poller that eventually produces a
// ModelDetails object
const modelDetails = await poller.pollUntilDone();
const {
modelId, // identical to the modelId given when creating the model
description, // identical to the description given when creating the model
createdOn, // the Date (timestamp) that the model was created
docTypes // information about the document types of the composed submodels
} = modelDetails;
function beginComposeDocumentModel(modelId: string, componentModelIds: Iterable<string>, options?: BeginComposeDocumentModelOptions): Promise<DocumentModelPoller>
參數
- modelId
-
string
要建立之模型的唯一標識碼
- componentModelIds
-
Iterable<string>
可反覆運算的字串,代表要撰寫之模型的唯一模型標識碼
- options
- BeginComposeDocumentModelOptions
模型建立的選擇性設定
傳回
Promise<DocumentModelPoller>
長時間執行的作業 (poller) 最終會產生已建立的模型資訊或錯誤
beginCopyModelTo(string, CopyAuthorization, BeginCopyModelOptions)
將具有指定標識碼的模型複製到由指定複製授權編碼的資源和模型標識碼。
請參閱 CopyAuthorization 和 getCopyAuthorization。
例
// We need a client for the source model's resource
const sourceEndpoint = "https://<source resource name>.cognitiveservices.azure.com";
const sourceCredential = new AzureKeyCredential("<source api key>");
const sourceClient = new DocumentModelAdministrationClient(sourceEndpoint, sourceCredential);
// We create the copy authorization using a client authenticated with the destination resource. Note that these two
// resources can be the same (you can copy a model to a new ID in the same resource).
const copyAuthorization = await client.getCopyAuthorization("<destination model ID>");
// Finally, use the _source_ client to copy the model and await the copy operation
const poller = await sourceClient.beginCopyModelTo("<source model ID>");
// Model copying, like all other model creation operations, returns a poller that eventually produces a ModelDetails
// object
const modelDetails = await poller.pollUntilDone();
const {
modelId, // identical to the modelId given when creating the copy authorization
description, // identical to the description given when creating the copy authorization
createdOn, // the Date (timestamp) that the model was created
docTypes // information about the document types of the model (identical to the original, source model)
} = modelDetails;
function beginCopyModelTo(sourceModelId: string, authorization: CopyAuthorization, options?: BeginCopyModelOptions): Promise<DocumentModelPoller>
參數
- sourceModelId
-
string
將複製之來源模型的唯一標識碼
- authorization
- CopyAuthorization
使用 getCopyAuthorization 建立模型的授權
- options
- BeginCopyModelOptions
選用的設定
傳回
Promise<DocumentModelPoller>
長時間執行的作業 (poller) 最終會產生複製的模型資訊或錯誤
deleteDocumentClassifier(string, OperationOptions)
如果存在,則會從客戶端資源中刪除具有指定標識碼的分類器。 無法還原此作業。
例
await client.deleteDocumentClassifier("<classifier ID to delete>"));
function deleteDocumentClassifier(classifierId: string, options?: OperationOptions): Promise<void>
參數
- classifierId
-
string
要從資源中刪除之分類器的唯一標識碼
- options
- OperationOptions
要求的選擇性設定
傳回
Promise<void>
deleteDocumentModel(string, DeleteDocumentModelOptions)
如果模型存在,則會從客戶端的資源中刪除具有指定標識符的模型。 無法還原此作業。
例
await client.deleteDocumentModel("<model ID to delete>"));
function deleteDocumentModel(modelId: string, options?: DeleteDocumentModelOptions): Promise<void>
參數
- modelId
-
string
要從資源中刪除之模型的唯一標識符
- options
- DeleteDocumentModelOptions
要求的選擇性設定
傳回
Promise<void>
getCopyAuthorization(string, GetCopyAuthorizationOptions)
建立授權,將模型複製到與 beginCopyModelTo
方法搭配使用的資源。
CopyAuthorization
會授與另一個認知服務資源,以使用模型標識碼和編碼為授權的選擇性描述,在此客戶端的資源中建立模型的許可權。
例
// The copyAuthorization data structure stored below grants any cognitive services resource the right to copy a
// model into the client's resource with the given destination model ID.
const copyAuthorization = await client.getCopyAuthorization("<destination model ID>");
function getCopyAuthorization(destinationModelId: string, options?: GetCopyAuthorizationOptions): Promise<CopyAuthorization>
參數
- destinationModelId
-
string
目的地模型的唯一識別碼(要複製模型的識別碼)
- options
- GetCopyAuthorizationOptions
建立複製授權的選擇性設定
傳回
Promise<CopyAuthorization>
編碼指定modelId和選擇性描述的複製授權
getDocumentClassifier(string, OperationOptions)
依標識符擷取分類器的相關信息(DocumentClassifierDetails)。
例
const classifierId = "<classifier ID";
const {
classifierId, // identical to the ID given when calling `getDocumentClassifier`
description, // a textual description of the classifier, if provided during classifier creation
createdOn, // the Date (timestamp) that the classifier was created
// information about the document types in the classifier and their corresponding traning data
docTypes
} = await client.getDocumentClassifier(classifierId);
// The `docTypes` property is a map of document type names to information about the training data
// for that document type.
for (const [docTypeName, classifierDocTypeDetails] of Object.entries(docTypes)) {
console.log(`- '${docTypeName}': `, classifierDocTypeDetails);
}
function getDocumentClassifier(classifierId: string, options?: OperationOptions): Promise<DocumentClassifierDetails>
參數
- classifierId
-
string
要查詢之分類器的唯一標識符
- options
- OperationOptions
要求的選擇性設定
傳回
Promise<DocumentClassifierDetails>
具有指定標識碼之分類器的相關信息
getDocumentModel(string, GetModelOptions)
依標識符擷取模型的相關信息(DocumentModelDetails)。
這個方法可以擷取自定義和預先建置模型的相關信息。
重大變更
在舊版的窗體辨識器 REST API 和 SDK 中,getModel
方法可能會傳回任何模型,即使是因為錯誤而無法建立的模型。 在新的服務版本中,getDocumentModel
和 listDocumentModels
只會產生成功建立的模型(也就是「已準備好」使用的模型)。 失敗的模型現在會透過「作業」API 擷取,請參閱 getOperation 和 listOperations。
例
// The ID of the prebuilt business card model
const modelId = "prebuilt-businessCard";
const {
modelId, // identical to the modelId given when calling `getDocumentModel`
description, // a textual description of the model, if provided during model creation
createdOn, // the Date (timestamp) that the model was created
// information about the document types in the model and their field schemas
docTypes: {
// the document type of the prebuilt business card model
"prebuilt:businesscard": {
// an optional, textual description of this document type
description,
// the schema of the fields in this document type, see the FieldSchema type
fieldSchema,
// the service's confidences in the fields (an object with field names as properties and numeric confidence
// values)
fieldConfidence
}
}
} = await client.getDocumentModel(modelId);
function getDocumentModel(modelId: string, options?: GetModelOptions): Promise<DocumentModelDetails>
參數
- modelId
-
string
要查詢之模型的唯一標識碼
- options
- GetModelOptions
要求的選擇性設定
傳回
Promise<DocumentModelDetails>
具有指定標識碼之模型的相關信息
getOperation(string, GetOperationOptions)
依作業標識符擷取作業的相關信息(OperationDetails
)。
作業代表非分析工作,例如建置、撰寫或複製模型。
function getOperation(operationId: string, options?: GetOperationOptions): Promise<OperationDetails>
參數
- operationId
-
string
要查詢之作業的標識碼
- options
- GetOperationOptions
要求的選擇性設定
傳回
Promise<OperationDetails>
具有指定標識碼之作業的相關信息
例
// The ID of the operation, which should be a GUID
const operationId = "<operation GUID>";
const {
operationId, // identical to the operationId given when calling `getOperation`
kind, // the operation kind, one of "documentModelBuild", "documentModelCompose", or "documentModelCopyTo"
status, // the status of the operation, one of "notStarted", "running", "failed", "succeeded", or "canceled"
percentCompleted, // a number between 0 and 100 representing the progress of the operation
createdOn, // a Date object that reflects the time when the operation was started
lastUpdatedOn, // a Date object that reflects the time when the operation state was last modified
} = await client.getOperation(operationId);
getResourceDetails(GetResourceDetailsOptions)
擷取此客戶端資源的基本資訊。
例
const {
// Information about the custom models in the current resource
customDocumentModelDetails: {
// The number of custom models in the current resource
count,
// The maximum number of models that the current resource can support
limit
}
} = await client.getResourceDetails();
function getResourceDetails(options?: GetResourceDetailsOptions): Promise<ResourceDetails>
參數
- options
- GetResourceDetailsOptions
要求的選擇性設定
傳回
Promise<ResourceDetails>
此客戶端資源的基本資訊
listDocumentClassifiers(ListModelsOptions)
列出資源中分類器的詳細數據。 此作業支援分頁。
例子
異步反覆運算
for await (const details of client.listDocumentClassifiers()) {
const {
classifierId, // The classifier's unique ID
description, // a textual description of the classifier, if provided during creation
docTypes, // information about the document types in the classifier and their corresponding traning data
} = details;
}
依頁面
// The listDocumentClassifiers method is paged, and you can iterate by page using the `byPage` method.
const pages = client.listDocumentClassifiers().byPage();
for await (const page of pages) {
// Each page is an array of classifiers and can be iterated synchronously
for (const details of page) {
const {
classifierId, // The classifier's unique ID
description, // a textual description of the classifier, if provided during creation
docTypes, // information about the document types in the classifier and their corresponding traning data
} = details;
}
}
function listDocumentClassifiers(options?: ListModelsOptions): PagedAsyncIterableIterator<DocumentClassifierDetails, DocumentClassifierDetails[], PageSettings>
參數
- options
- ListModelsOptions
分類器要求的選擇性設定
傳回
支援分頁之分類器詳細數據的異步反覆運算
listDocumentModels(ListModelsOptions)
列出資源中的模型摘要。 將包含自定義和預先建置的模型。 此作業支援分頁。
模型摘要(DocumentModelSummary)只包含模型的基本資訊,而且不包含模型中檔類型的相關信息(例如字段架構和信賴值)。
若要存取模型的完整資訊,請使用 getDocumentModel。
重大變更
在舊版的窗體辨識器 REST API 和 SDK 中,listModels
方法會傳回所有模型,即使是因為錯誤而無法建立的模型。 在新的服務版本中,listDocumentModels
和 getDocumentModel
只會產生成功建立的模型(也就是「已準備好」使用的模型)。 失敗的模型現在會透過「作業」API 擷取,請參閱 getOperation 和 listOperations。
例子
異步反覆運算
for await (const summary of client.listDocumentModels()) {
const {
modelId, // The model's unique ID
description, // a textual description of the model, if provided during model creation
} = summary;
// You can get the full model info using `getDocumentModel`
const model = await client.getDocumentModel(modelId);
}
依頁面
// The listDocumentModels method is paged, and you can iterate by page using the `byPage` method.
const pages = client.listDocumentModels().byPage();
for await (const page of pages) {
// Each page is an array of models and can be iterated synchronously
for (const model of page) {
const {
modelId, // The model's unique ID
description, // a textual description of the model, if provided during model creation
} = summary;
// You can get the full model info using `getDocumentModel`
const model = await client.getDocumentModel(modelId);
}
}
function listDocumentModels(options?: ListModelsOptions): PagedAsyncIterableIterator<DocumentModelSummary, DocumentModelSummary[], PageSettings>
參數
- options
- ListModelsOptions
模型要求的選擇性設定
傳回
支援分頁之模型摘要的異步反覆運算
listOperations(ListOperationsOptions)
列出資源中的模型建立作業。 這會產生所有作業,包括無法成功建立模型的作業。 此作業支援分頁。
例子
異步反覆運算
for await (const operation of client.listOperations()) {
const {
operationId, // the operation's GUID
status, // the operation status, one of "notStarted", "running", "succeeded", "failed", or "canceled"
percentCompleted // the progress of the operation, from 0 to 100
} = operation;
}
依頁面
// The listOperations method is paged, and you can iterate by page using the `byPage` method.
const pages = client.listOperations().byPage();
for await (const page of pages) {
// Each page is an array of operation info objects and can be iterated synchronously
for (const operation of page) {
const {
operationId, // the operation's GUID
status, // the operation status, one of "notStarted", "running", "succeeded", "failed", or "canceled"
percentCompleted // the progress of the operation, from 0 to 100
} = operation;
}
}
function listOperations(options?: ListOperationsOptions): PagedAsyncIterableIterator<OperationSummary, OperationSummary[], PageSettings>
參數
- options
- ListOperationsOptions
作業要求的選擇性設定
傳回
支援分頁之作業資訊對象的異步反覆運算