HotNewsRecommend - Recommend trending news
Recommends trending news.
Usage notes
Understands user intent and retrieves the trending topic list of the corresponding channel, for example, "Read sports news." This is a legacy API. We recommend that you use the broadcast list (trending list) question answering API RunHotTopicChat, which fully covers the capabilities of this API.
You can try it in the console.
For information about calling the API by using SDKs, see the Java and Python examples under "API" in the console.
Try it out
You can run this API directly in OpenAPI Explorer, which saves you the trouble of calculating signatures. After the API runs successfully, OpenAPI Explorer can automatically generate SDK code examples.
Authorization information
The following table describes the authorization information of the API. You can use it in the Action element of a RAM policy statement to grant a RAM user or RAM role the permission to call the API. The details are as follows:
-
Action: a specific permission.
-
Access level: the access level of each action. Valid values: Write, Read, and List.
-
Resource type: the resource types that the action supports for authorization. The details are as follows:
- Required resource types are marked with an asterisk (*).
- For actions that do not support resource-level authorization,
All resourcesis used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Dependent action: the additional permissions required to successfully perform the action. The caller must also have permission to perform the dependent actions for the operation to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| quanmiaolightapp:HotNewsRecommend | create | *All resources * |
| None |
Request syntax
POST /{workspaceId}/quanmiao/lightapp/hotNewsRecommend HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| prompt | string | No | The prompt for news recommendations. | Today's financial news |
| workspaceId | string | Yes | llm-xxx |
Response parameters
| Name | Type | Description | Example |
|---|---|---|---|
| object | Schema of Response | ||
| requestId | string | The unique identifier generated by Alibaba Cloud for this request. | 575D5893-01DB-5C81-A899-74F67616762A |
| code | string | The response code. 200: success. Other values: error codes. For more information about error codes, see Error codes. | 200 |
| success | boolean | Indicates whether the call is successful. true: success. false: failure. | True |
| message | string | The error description. | ok |
| data | object | The news recommendation results. | |
| news | array<object> | The list of recommended news. | |
| news | object | The recommended news object. | |
| title | string | The title. | xx |
| content | string | The content. | xx |
| url | string | The URL. | http://xxx |
| pubTime | string | The publication time. | 2024-09-10 15:32:00 |
| source | string | The news source. | Xinhua News Agency |
| searchSource | string | The search source. | QuarkCommonNews: web search. |
| imageUrls | array | The news image list. | |
| imageUrls | string | The image URL list. | http://www.example.com/xxx.png |
Examples
Sample success response
JSON format
{
"requestId": "575D5893-01DB-5C81-A899-74F67616762A",
"code": 200,
"success": true,
"message": "ok",
"data": {
"news": [
{
"title": "xx",
"content": "xx",
"url": "http://xxx",
"pubTime": "2024-09-10 15:32:00",
"source": "新华社",
"searchSource": "QuarkCommonNews:联网检索",
"imageUrls": [
"http://www.example.com/xxx.png"
]
}
]
}
}
Error codes
For more error codes, visit the Error Center.