通過執行個體ID查詢指定條件下的模型列表。
介面說明
請求說明
本 API 用於從指定執行個體中擷取模型列表,支援通過模型名稱、類型以及分頁參數進行篩選。請求時需提供執行個體 ID 作為路徑參數,其他篩選條件為可選的查詢參數。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
searchengine:ListModels |
list |
*Instance
|
無 | 無 |
請求文法
GET /openapi/ha3/instances/{instanceId}/models HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| instanceId |
string |
是 |
執行個體 ID |
ha-cn-test |
| name |
string |
否 |
模型名稱 |
test1 |
| type |
string |
否 |
模型類別 |
text_embedding |
| pageNumber |
integer |
否 |
頁數,預設為 1 |
1 |
| pageSize |
integer |
否 |
每頁顯示條數,預設為 10 |
10 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
返回參數包括請求 ID 和模型列表,其中模型列表中的每個元素包含模型的詳細資料如名稱、類型、URL、狀態等。 |
||
| requestId |
string |
請求 ID |
38b079f1-7846-4226-8c90-3e2644b5c52b |
| totalCount |
integer |
總數 |
14 |
| result |
array<object> |
模型列表參考:Model |
|
|
object |
模型資訊 |
||
| name |
string |
模型名稱 |
test |
| type |
string |
模型類別
|
text_embedding |
| url |
string |
模型服務的訪問地址 |
http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001 |
| status |
string |
模型狀態。
|
ok |
| dimension |
integer |
模型的維度 |
128 |
| content |
object |
模型的內容資訊 |
|
| modelName |
string |
模型名稱 |
test |
| modelType |
string |
模型類別
|
text_embedding |
| url |
string |
模型服務的訪問地址 |
http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001 |
| method |
string |
模型服務訪問的 http method, 支援 PUT 和 POST |
POST |
| request |
object |
請求配置資訊 |
|
| header |
object |
訪問模型服務的 http header |
|
| Authorization |
string |
認證資訊,格式:Bearer access_token |
Bearer OS-v0********6vvs |
| Content-Type |
string |
HTTP 要求內容類型。 |
application/json |
| urlParams |
object |
url 中的參數,有限模型服務需要從 url 上傳遞參數。 |
|
| build |
object |
構建索引時傳遞的參數 |
key: value |
| search |
object |
查詢時傳遞的參數 |
key: value |
| requestBody |
string |
請求 Body 體的模板字串 |
{\"input\": [\"%{input}\"], \"input_type\": \"%{input_type}\"} |
| parameters |
object |
如果 body 中的參數需要區分 build 和 search 階段,可以定義在這個參數中。 |
|
| build |
object |
索引構建階段的參數 |
|
| input_type |
string |
輸入類型 |
query |
| search |
object |
查詢階段的參數 |
|
| input_type |
string |
輸入類型 |
document |
| response |
object |
如何解析結果資訊,使用 json path 格式描述 |
|
| embeddings |
string |
如何解析結果資訊,使用 json path 格式描述 |
$.result.embeddings[*].embedding |
| createTime |
string |
建立時間 |
2024-05-21 16:05:26 |
| updateTime |
string |
修改時間 |
2024-05-21 16:05:26 |
樣本
正常返回樣本
JSON格式
{
"requestId": "38b079f1-7846-4226-8c90-3e2644b5c52b",
"totalCount": 14,
"result": [
{
"name": "test",
"type": "text_embedding",
"url": "http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001",
"status": "ok",
"dimension": 128,
"content": {
"modelName": "test",
"modelType": "text_embedding",
"url": "http://***.platform-cn-shanghai.opensearch.aliyuncs.com/v3/openapi/workspaces/default/text-embedding/ops-text-embedding-001",
"method": "POST",
"request": {
"header": {
"Authorization": "Bearer OS-v0********6vvs\n",
"Content-Type": "application/json\n"
},
"urlParams": {
"build": {
"test": "test",
"test2": 1
},
"search": {
"test": "test",
"test2": 1
}
},
"requestBody": "{\\\"input\\\": [\\\"%{input}\\\"], \\\"input_type\\\": \\\"%{input_type}\\\"}",
"parameters": {
"build": {
"input_type": "query\n"
},
"search": {
"input_type": "document\n"
}
}
},
"response": {
"embeddings": "$.result.embeddings[*].embedding\n"
}
},
"createTime": "2024-05-21 16:05:26",
"updateTime": "2024-05-21 16:05:26"
}
]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。