All Products
Search
Document Center

Alibaba Cloud Linux:GenerateCopilotStreamResponse

Last Updated:Sep 11, 2026

Provides a streaming SSE interface for the OS Copilot service.

Operation description

  • Use this operation together with the call_sseapi interface in the aliyun-tea-openapi-inner package.

  • Populate the parameters based on the standard LLM service input parameters, convert them to a string, and assign the string to llmParamString.

  • Convert the returned string data to a dict before use. Refer to the standard LLM service response format.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sysom:GenerateCopilotStreamResponse

none

*All Resource

*

None None

Request syntax

POST /api/v1/copilot/generate_copilot_stream_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 interface input parameter dict. Convert the dict 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 format. If the data is a dict, convert and parse it yourself.

{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'Alinux is a Linux-based open source operating system primarily developed and maintained by Alibaba Group, 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 areas that require handling high-load scenarios. 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}}

message

string

The error message. 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\n",
  "data": "{'choices': [{'finish_reason': 'stop', 'index': 0, 'message': {'content': 'Alinux is a Linux-based open source operating system primarily developed and maintained by Alibaba Group, 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 demands within Alibaba. Due to its excellent performance and stability, Alinux has gradually been adopted by external enterprises and research institutions, especially in areas that require handling high-load scenarios. Compared to 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 progression 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}}",
  "message": "Requests for llm service failed\n",
  "requestId": "2D693121-C925-5154-8DF6-C09A8B369822\n"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.