Creating a model
Function
The API is used to configure the added NLP model, including the model name, model description, model endpoint, and model deployment_id.
URI
POST /v1/koosearch/models
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Parameter description: Token used for API authentication. For how to obtain the token, see section 3.2 "Authentication." Constraints: N/A. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Model name |
detail |
Yes |
String |
Model description |
endpoint |
Yes |
String |
Model endpoint |
type |
Yes |
String |
Model type: Pangu_chat Pangu chat model pangu_llm Pangu model deployed on bare metal embedding Embedding model query2query query2query model rerank Reranking model search_plan Search planning model llm LLM |
extend_config |
Yes |
ModelExtendConfig object |
Customized model configuration in JSON format |
alias |
No |
String |
Model name required for the Ascend model scenario |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
iam_info |
Yes |
IamInfo object |
IAM authentication agency information |
custom_header |
No |
map<string, object> |
Extended request header |
deployment_id |
No |
String |
deployment_id of a model |
vector_config |
No |
VectorConfig object |
Vector model configuration. |
nlp_config |
No |
NlpConfig object |
Configuration of the NLP foundation model. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
iam_enabled |
No |
Boolean |
Indicates whether to enable authentication |
agency_enabled |
No |
Boolean |
Indicates whether to use an agency account for authentication |
project_id |
No |
String |
Project ID of the IAM user. This parameter is mandatory when iam_enable is set to true. |
domain_name |
No |
String |
Name of the agency account |
agency_name |
No |
String |
Agency name. |
Response Parameters
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
|
error_msg |
String |
Error description |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
|
error_msg |
String |
Error description |
Example Requests
POST https://{endpoint}/v1/koosearch/models { "name" : "pangu_v30_32k", "type" : "pangu_llm", "endpoint" : "http://10.0.0.169:31010", "detail" : "panguv30_4k", "extend_config" : { "deployment_id" : "panguv30_4k", "iam_info" : { "project_id" : "123", "iam_enabled" : false, "agency_enabled" : false }, "nlp_config" : { "context_length" : 32 } } }
Example Responses
None
Status Codes
Status Code |
Description |
---|---|
200 |
The addition is successful. |
400 |
Invalid request body |
500 |
Internal error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot