diff --git a/api/@ohos.data.intelligence.d.ts b/api/@ohos.data.intelligence.d.ts index f80129e159c4392276ab92ff6d9bf91ed24f3fe8..abce83c31e2621f0a75dcf4759bdae11fd336272 100644 --- a/api/@ohos.data.intelligence.d.ts +++ b/api/@ohos.data.intelligence.d.ts @@ -23,7 +23,8 @@ * * @namespace intelligence * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace intelligence { /** @@ -36,7 +37,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ function getTextEmbeddingModel(config: ModelConfig): Promise; @@ -50,7 +52,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ function getImageEmbeddingModel(config: ModelConfig): Promise; @@ -59,7 +62,8 @@ declare namespace intelligence { * * @interface ModelConfig * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ interface ModelConfig { /** @@ -68,7 +72,8 @@ declare namespace intelligence { * * @type { ModelVersion } * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ version: ModelVersion; @@ -77,7 +82,8 @@ declare namespace intelligence { * * @type { boolean } * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ isNpuAvailable: boolean; @@ -86,7 +92,8 @@ declare namespace intelligence { * * @type { ?string } * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ cachePath?: string; } @@ -94,16 +101,18 @@ declare namespace intelligence { /** * Version of the model. * - * @enum { number } + * @enum { int } * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ enum ModelVersion { /** * The basic embedding model. * * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ BASIC_MODEL = 0 } @@ -114,7 +123,8 @@ declare namespace intelligence { * * @interface TextEmbedding * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ interface TextEmbedding { /** @@ -124,7 +134,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ loadModel(): Promise; @@ -135,7 +146,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ releaseModel(): Promise; @@ -144,30 +156,32 @@ declare namespace intelligence { * The model can process up to 512 characters of text per inference, supporting both Chinese and English. * * @param { string } text - The input text of the embedding model. - * @returns { Promise> } The promise used to return the embedding result. + * @returns { Promise> } The promise used to return the embedding result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - getEmbedding(text: string): Promise>; + getEmbedding(text: string): Promise>; /** * Obtains the embedding vector of a given batch of text. * The model can process up to 512 characters of text per inference, supporting both Chinese and English. * * @param { Array } batchTexts - The input batch of texts of the embedding model. - * @returns { Promise>> } The promise used to return the embedding result. + * @returns { Promise>> } The promise used to return the embedding result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - getEmbedding(batchTexts: Array): Promise>>; + getEmbedding(batchTexts: Array): Promise>>; } /** @@ -175,7 +189,8 @@ declare namespace intelligence { * * @interface ImageEmbedding * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ interface ImageEmbedding { /** @@ -185,7 +200,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ loadModel(): Promise; @@ -196,7 +212,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ releaseModel(): Promise; @@ -205,15 +222,16 @@ declare namespace intelligence { * The model can handle images below 20 MB in size in a single inference. * * @param { Image } image - The input image of the embedding model. - * @returns { Promise> } The promise used to return the embedding result. + * @returns { Promise> } The promise used to return the embedding result. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - getEmbedding(image: Image): Promise>; + getEmbedding(image: Image): Promise>; } /** @@ -221,7 +239,8 @@ declare namespace intelligence { * * @typedef { string } Image * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ type Image = string; @@ -236,7 +255,8 @@ declare namespace intelligence { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 31300000 - Inner error. * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ function splitText(text: string, config: SplitConfig): Promise>; @@ -245,26 +265,29 @@ declare namespace intelligence { * * @interface SplitConfig * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ interface SplitConfig { /** * The maximun size of chunks. * - * @type { number } + * @type { int } * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - size: number; + size: int; /** * The ratio of overlap between adjacent chunks. * - * @type { number } + * @type { double } * @syscap SystemCapability.DistributedDataManager.DataIntelligence.Core - * @since 15 + * @since arkts {'1.1':'15', '1.2':'20'} + * @arkts 1.1&1.2 */ - overlapRatio: number; + overlapRatio: double; } }