AISearchStream

Updated at:

Generates answers to customer questions based on structured element information stored in the database and retrieved content from the knowledge base.

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

energy:AISearchStream

none

*All Resource

*

None None

Request syntax

POST /api/v1/aiSearch/searchStream HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body parameters.

question

string

Yes

The user question.

“my net is slow, what can I do?”

message

array

No

The list of historical conversation records.

AISearchMessageItem

No

The historical conversation record.

folderId

string

Yes

The folder ID. The knowledge base retrieval feature retrieves Q&A content within the current folder and its subfolders.

1a851c4a-1d65-11ef-99a7-ssfsfdd

resourceTypeNeeded

array

No

Specifies the resource types to retrieve. Valid values:

  • text: knowledge base retrieval

  • miniapp: mini program retrieval in structured elements

  • product: product retrieval in structured elements If this parameter is not specified, all three resource types are retrieved by default.

string

No

The resource type to retrieve.

Valid values:

  • product :

    product

  • miniapp :

    miniapp

  • text :

    text

“text”

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

Id of the request

3F21E33A-42F8-50BC-89DE-DC0B96B967DD

data AISearchStreamItem

The returned data.

Examples

Success response

JSON format

{
  "requestId": "3F21E33A-42F8-50BC-89DE-DC0B96B967DD",
  "data": {
    "type": "text",
    "content": "“network problem can be”",
    "params": " [{\"type\": \"miniapp\", \"score\": 0.7404107, \"resourceId\": \"ja9bQZwBg5VwSU7n5Ijs\", \"miniappId\": null, \"title\": \"更新后的智能搜索测试助手\", \"version\": \"1.0.5\", \"description\": \"这是一个用于测试 AI 搜索功能的演示小程序\", \"slogan\": \"搜索即所得\", \"icon\": \"https://img.alicdn.com/test_icon.png\", \"url\": null, \"detailDescription\": \"该小程序提供了完整的 AI 搜索链路测试。\"}]"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.