Retrieves the response result from the Copilot service.
Operation description
Populate parameters according to the standard LLM service input parameters, convert them to a string, and assign the string to llmParamString.
Convert the returned data from a string to a dict before use. Refer to the standard LLM service response format.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
sysom:GenerateCopilotResponse |
none |
*All Resource
|
None | None |
Request syntax
POST /api/v1/copilot/generate_copilot_response HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| llmParamString |
string |
No |
The input parameter for the Copilot LLM service. Refer to the standard LLM API input parameter dict, convert it to a string, and pass it to llmParamString. |
"{\"model\":\"Qwen-7B-Chat\",\"temperature\":0.9,\"max_tokens\":1000,\"top_p\":1,\"frequency_penalty\":0.0,\"presence_penalty\":0.6,\"messages\":[{\"role\":\"user\",\"content\":\"I am an OS engineer\"},{\"role\":\"assistant\",\"content\":\"Hello. I am an AI language model, happy to help you. What can I do for you?\"},{\"role\":\"user\",\"content\":\"Do you know what Alinux is?\"}]}" |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| code |
string |
The error code. |
SysomOpenAPI.ServerError |
| data |
string |
The data returned by the LLM service in string type. If the data is a dict, convert and parse it yourself. |
{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'Alinux is an open-source operating system based on Linux. It is primarily developed and maintained by Alibaba Group and is designed for large-scale cloud computing and big data processing environments. The system has been deeply customized and optimized for high concurrency, low latency, and resource utilization to meet the complex and massive business requirements within Alibaba. Due to its excellent performance and stability, Alinux has gradually been adopted by external enterprises and research institutions, especially in scenarios that require handling high workloads. Compared with standard Linux distributions, Alinux may include specific kernel patches, optimization toolsets, and other features developed internally by Alibaba. However, it is worth noting that although the "Ali" in the name may suggest a close relationship with Alibaba, Alinux as a project became a sub-project under the OpenAtom Foundation in 2021, known as OpenAnolis, marking its progress toward community-driven and broader adoption.', 'role': 'assistant'}}], 'model': 'Qwen1.5', 'sentiment': [], 'status_code': 200, 'time': 6.836989402770996, 'usage': {'completion_tokens': 180, 'prompt_tokens': 176, 'time_dict': {'auto_regression_time': 0.03798324399524265, 'speed': 26.327398474054736, 'total_generate_time': 6.836983919143677}, 'total_tokens': 356}} |
| massage |
string |
The error code description. This value is empty if no error occurs. |
Requests for llm service failed |
| requestId |
string |
Id of the request |
2D693121-C925-5154-8DF6-C09A8B369822 |
Examples
Success response
JSON format
{
"code": "SysomOpenAPI.ServerError",
"data": "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'Alinux is an open-source operating system based on Linux. It is primarily developed and maintained by Alibaba Group and is designed for large-scale cloud computing and big data processing environments. The system has been deeply customized and optimized for high concurrency, low latency, and resource utilization to meet the complex and massive business requirements within Alibaba. Due to its excellent performance and stability, Alinux has gradually been adopted by external enterprises and research institutions, especially in scenarios that require handling high workloads. Compared with standard Linux distributions, Alinux may include specific kernel patches, optimization toolsets, and other features developed internally by Alibaba. However, it is worth noting that although the \"Ali\" in the name may suggest a close relationship with Alibaba, Alinux as a project became a sub-project under the OpenAtom Foundation in 2021, known as OpenAnolis, marking its progress toward community-driven and broader adoption.', 'role': 'assistant'}}], 'model': 'Qwen1.5', 'sentiment': [], 'status_code': 200, 'time': 6.836989402770996, 'usage': {'completion_tokens': 180, 'prompt_tokens': 176, 'time_dict': {'auto_regression_time': 0.03798324399524265, 'speed': 26.327398474054736, 'total_generate_time': 6.836983919143677}, 'total_tokens': 356}}",
"massage": "Requests for llm service failed",
"requestId": "2D693121-C925-5154-8DF6-C09A8B369822"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.