Domain name for API request: lkeap.intl.tencentcloudapi.com.
This API is used to call the text representation model to convert text into a vector represented by numbers, which can be used in scenarios such as text retrieval, information recommendation, and knowledge mining. There is a single-account call limit control for this API. If you need to increase the concurrency limit, please contact us (https://cloud.tencent.com/act/event/Online_service).
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: GetEmbedding. |
| Version | Yes | String | Common Params. The value used for this API: 2024-05-22. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. This API only supports: ap-jakarta. |
| Model | Yes | String | Select the model for generating vectors Note: Optional [adp-text-embedding-0.5b] |
| Inputs.N | Yes | Array of String | Text that requires embedding. The maximum length of a single text is 500 characters. The maximum total number of entries is 7. |
| TextType | No | String | The type of text vectorization. To achieve better retrieval performance, it is recommended to distinguish between query text and document text types. For symmetric tasks such as clustering and classification, there is no need for special specification simply use the system default value "document". |
| Instruction | No | String | This field is not currently supported. |
| Parameter Name | Type | Description |
|---|---|---|
| Data | Array of EmbeddingObject | Feature. |
| Usage | Usage | Consumption. Returns TotalToken. |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
POST / HTTP/1.1
Host: lkeap.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetEmbedding
<Common request parameters>
{
"Model": "adp-text-embedding-0.5b",
"Inputs": [
"Hello."
]
}{
"Response": {
"Data": [
{
"Embedding": [
0
]
}
],
"RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
"Usage": {
"TotalTokens": 3
}
}
}
POST / HTTP/1.1
Host: lkeap.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetEmbedding
<Common request parameters>
{
"Model": "adp-text-embedding-0.5b",
"Inputs": [
"Hello",
"Word"
]
}{
"Response": {
"Data": [
{
"Embedding": [
0
]
},
{
"Embedding": [
0
]
}
],
"RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
"Usage": {
"TotalTokens": 3
}
}
}
POST / HTTP/1.1
Host: lkeap.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: GetEmbedding
<Common request parameters>
{
"Model": "adp-text-embedding-0.5b",
"Inputs": [
"Hello",
"Word"
]
}{
"Response": {
"Data": [
{
"Embedding": [
0
]
},
{
"Embedding": [
0
]
}
],
"RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
"Usage": {
"TotalTokens": 3
}
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation | Operation failed. |
| ResourceUnavailable.ResourcePackageRunOut | The account resource package is exhausted. |
Feedback