OS Copilot hizmeti için akışlı bir SSE arabirimi sağlar.
Operation description
Bu işlemi aliyun-tea-openapi-inner paketindeki call_sseapi arabirimi ile birlikte kullanın.
Parametreleri standart LLM hizmeti giriş parametrelerine göre doldurun, bunları bir dizeye dönüştürün ve dizeyi llmParamString parametresine atayın.
Kullanmadan önce döndürülen dize verilerini bir dict yapısına dönüştürün. Standart LLM hizmeti yanıt biçimine bakın.
Try it now
Test
RAM authorization
|
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 |
İstek gövdesi. |
|
| llmParamString |
string |
No |
Copilot LLM hizmeti için giriş parametresi. Standart LLM arabirimi giriş parametresi dict yapısına bakın. Dict yapısını bir dizeye dönüştürün ve llmParamString parametresine iletin. |
"{\"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 |
Yanıt şeması. |
||
| code |
string |
Hata kodu. |
SysomOpenAPI.ServerError |
| data |
string |
LLM hizmeti tarafından dize biçiminde döndürülen veriler. Veriler bir dict yapısıysa, bunu kendiniz dönüştürün ve ayrıştırın. |
{'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 |
Hata mesajı. Herhangi bir hata oluşmazsa bu değer boştur. |
Requests for llm service failed |
| requestId |
string |
İstek kimliği. |
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.