AI妙搜-智能搜索生成。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用背景高亮的方式表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
aimiaobi:RunSearchGeneration | create | *全部资源 * |
| 无 |
请求语法
POST /quanmiao/aimiaosou/runSearchGeneration HTTP/1.1
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
WorkspaceId | string | 是 | 业务空间 id,请登录百炼后,在左上角业务空间详情中获取。 | llm-xxx |
TaskId | string | 否 | 会话任务唯一标识 | 7AA2AE16-D873-5C5F-9708-15396C382EB1 |
Prompt | string | 否 | 搜索词 | 杭州亚运会吉祥物是什么 |
OriginalSessionId | string | 否 | 原会话唯一标识:通常为空,非空时,表示当前对话基于此轮对话生成,会加载原始轮对话参数,搜索结果等,同时会替换生成结果,适用于,重新生成、修改数据源、新增 agent 生成场景 | xxx |
ChatConfig | object | 否 | 会话配置 | |
GenerateTechnology | string | 否 | 生成技术:
| copilotPrecise |
SearchParam | object | 否 | 搜索参数。 | |
StartTime | long | 否 | 开始时间 | 1725983999999 |
EndTime | long | 否 | 结束时间 | 1725983999999 |
SearchSources | array<object> | 否 | 搜索源列表 | |
SearchSource | object | 否 | 搜索源 | |
Code | string | 否 | 搜索源类型:
| SystemSearch |
DatasetName | string | 否 | 搜索源唯一标识 | QuarkCommonNews |
MultimodalSearchTypes | array | 否 | 搜索范围列表 | |
MultimodalSearchType | string | 否 | 搜索范围:
| text |
SearchModels | array | 否 | 搜索类型列表 | |
SearchModel | string | 否 | 搜索类型:
| TextGenerate |
GenerateLevel | string | 否 | 回答的详细程度:
| concise |
AgentContext | object | 否 | 上下文 | |
BizContext | object | 否 | 业务上下文 | |
MultimodalMediaSelection | object | 否 | 用户输入或选中的多模态数据 | |
SelectionType | string | 否 | 参照数据来源类型,取值范围: ‒ 全量的:all,历史会话中取全量数据,仅支持聚类场景; ‒ 选中的:selected,生成时,会取 textSearchResult 中数据; | all |
SessionId | string | 否 | 生成参照会话唯一标识:搜索生成时当前对话下取数据,比如聚类,目前仅媒资搜索场景-聚类需要 | 3f7045e099474ba28ceca1b4eb6d6e21 |
OriginalSessionId | string | 否 | 原始会话唯一标识:搜索结果取这个会话中的全量,目前仅媒资搜索场景需要 | 原始会话唯一标识:搜索结果取这个会话中的全量,目前仅媒资搜索场景需要 |
SearchModel | string | 否 | 仅聚类,对聚类子类内容二次聚类时传入,ClusterGenerate | TextGenerate |
SearchModelDataValue | string | 否 | searchModel=ClusterGenerate 时,取子类 topic 名称,注意如果原值有引号时也要带上 | 分类1 |
TextSearchResult | object | 否 | 文本搜索结果 | |
SearchResult | array<object> | 否 | 文本搜索结果列表 | |
SearchResult | object | 否 | ||
SearchSourceType | string | 否 | 搜索信源类型,同 searchSource.code | SystemSearch |
SearchSource | string | 否 | 搜索信源唯一标识,同 searchSource.datasetName | QuarkCommonNews |
SearchSourceName | string | 否 | 搜索信源名称 | 互联网搜索 |
PubTime | string | 否 | 发布时间 | 2024-11-25 14:25:59 |
Source | string | 否 | 来源 | 新华社 |
Title | string | 否 | 标题 | 文章标题 |
Content | string | 否 | 内容 | 文章内容 |
Url | string | 否 | 文章 URL | https://www.example.com/aaa.docx |
Summary | string | 否 | 文章摘要 | 文章摘要 |
DocUuid | string | 否 | 内部文档唯一标识 | xxx |
Score | float | 否 | 相关度 | 1 |
Chunks | array | 否 | 相关 chunk | |
Chunk | string | 否 | 片段 | xx |
DocId | string | 否 | 文档-自定义的唯一 ID | 文档-自定义的唯一ID |
返回参数
示例
正常返回示例
JSON
格式
{
"Payload": {
"Output": {
"AgentContext": {
"BizContext": {
"CurrentStep": "start",
"NextStep": "search",
"GeneratedContent": {
"ClusterTopicResult": {
"ClusterTopics": [
{
"Topic": "xx",
"ImageSearchResult": {
"SearchResult": [
{
"Article": {
"SearchSourceName": "互联网搜索",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"FileUrl": "xx"
}
],
"Current": 1,
"Size": 1,
"Total": 1
},
"TextSearchResult": {
"SearchResult": [
{
"SearchSourceType": "SystemSearch",
"SearchSource": "QuarkCommonNews",
"SearchSourceName": "互联网搜索",
"PubTime": "2023-04-04 08:39:09",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx",
"MultimodalMedias": [
{
"MediaId": "xx",
"MediaType": "image",
"FileUrl": "xx"
}
]
}
],
"Current": 1,
"Size": 1,
"Total": 1
},
"VideoSearchResult": {
"SearchResult": [
{
"Article": {
"SearchSourceName": "互联网搜索",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"ClipInfos": [
{
"Score": 0.9,
"From": 1,
"To": 1,
"Text": "xx",
"Type": "asr"
}
],
"FileUrl": "xx"
}
],
"Current": 1,
"Size": 1,
"Total": 1
}
}
],
"TextGenerate": "xx",
"GenerateFinished": true
},
"ExcerptResult": {
"TextGenerate": "xx",
"SearchResult": [
{
"TraceabilityId": 1,
"SearchSourceType": "SystemSearch",
"SearchSource": "QuarkCommonNews",
"SearchSourceName": "互联网搜索",
"PubTime": "2023-04-04 08:39:09",
"Title": "xx",
"Content": "xx",
"Url": "xx",
"Summary": "xx",
"Excerpt": "xx",
"Select": true,
"DocUuid": "xx",
"Score": 0.99,
"Chunks": [
"xx"
],
"DocId": "xx",
"TextGenerateMultimodalMediaList": [
{
"Start": 1,
"End": 1,
"DocUuid": "xx",
"MultimodalMediaList": [
{
"Article": {
"DocId": "xx",
"DocUuid": "xx",
"SearchSourceName": "互联网搜索",
"Title": "xx",
"Url": "xx"
},
"MediaId": "xx",
"MediaType": "image",
"FileUrl": "xx"
}
]
}
],
"MultimodalMedias": [
{
"MediaId": "xx",
"MediaType": "image",
"FileUrl": "xx"
}
]
}
],
"GenerateFinished": true,
"GenerateLevel": "concise"
},
"NewsElementResult": {
"TextGenerate": "x",
"NewsElementArticleList": [
{
"TextGenerate": "xx",
"Article": {
"SearchSourceType": "SystemSearch",
"SearchSource": "QuarkCommonNews",
"SearchSourceName": "互联网搜索",
"PubTime": "2023-04-04 08:39:09",
"Title": "xx",
"Content": "xx",
"Url": "xx",
"Summary": "xx",
"Select": true,
"DocUuid": "xx",
"Score": 0.99,
"DocId": "xx"
},
"NewsElementList": [
{
"Time": "时间",
"Location": "xx",
"People": "xx",
"Event": {
"CauseList": [
"xx"
],
"ProcessList": [
"xx"
],
"ResultList": [
"xx"
]
}
}
]
}
],
"GenerateFinished": true
},
"TextGenerateResult": {
"TextGenerate": "xx",
"TextGenerateMultimodalMediaList": [
{
"Start": 1,
"End": 1,
"MultimodalMediaList": [
{
"Article": {
"SearchSourceName": "xx",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"MediaType": "image",
"FileUrl": "xx"
}
]
}
],
"ReferenceList": [
{
"TraceabilityId": 1,
"SearchSourceType": "SystemSearch",
"SearchSource": "QuarkCommonNews",
"SearchSourceName": "互联网搜索",
"PubTime": "2023-04-04 08:39:09",
"Source": "新华社",
"Title": "xx",
"Content": "xx",
"Url": "xx",
"Summary": "xx",
"Select": true,
"DocUuid": "xx",
"Score": 0.99,
"Chunks": [
"xx"
],
"DocId": "xx"
}
],
"MultimodalSearchResultList": [
{
"SearchResult": [
{
"Article": {
"SearchSourceName": "xx",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"MediaType": "image",
"ClipInfos": [
{
"Score": 0.1,
"From": 1,
"To": 1,
"Text": "xx",
"Type": "asr"
}
],
"FileUrl": "xx"
}
],
"TimelineDateStr": "时间脉络-时间",
"Current": 1,
"Size": 1,
"Total": 1,
"SearchType": "realtime",
"SearchQuery": "xx"
}
],
"GenerateTraceability": {
"Duplicate": 0.9,
"Coordinates": [
{
"GenerateCoordinate": {
"X": 1,
"Y": 1,
"Z": 1
},
"NewsCoordinate": {
"X": 1,
"Y": 1,
"Z": 1
}
}
]
},
"GenerateFinished": true,
"GenerateLevel": "concise"
},
"TimelineResult": {
"TextGenerate": "xx",
"ReferenceList": [
{
"TraceabilityId": 1,
"SearchSourceType": "SystemSearch",
"SearchSource": "QuarkCommonNews",
"SearchSourceName": "互联网搜索",
"PubTime": "2023-04-04 08:39:09",
"Source": "新华社",
"Title": "xx",
"Content": "xx",
"Url": "xx",
"Summary": "xx",
"Select": true,
"DocUuid": "xx",
"Score": 0.99,
"Chunks": [
"xx"
],
"DocId": "xx"
}
],
"MultimodalSearchResultList": [
{
"SearchResult": [
{
"Article": {
"SearchSourceName": "互联网搜索",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"MediaType": "image",
"ClipInfos": [
{
"Score": 0.99,
"From": 1,
"To": 1,
"Text": "xx",
"Type": "asr"
}
],
"FileUrl": "xx"
}
],
"TimelineDateStr": "2024-09-11"
}
],
"GenerateTraceability": {
"Duplicate": 0.9,
"Coordinates": [
{
"GenerateCoordinate": {
"X": 1,
"Y": 1,
"Z": 1
},
"NewsCoordinate": {
"X": 1,
"Y": 1,
"Z": 1
}
}
]
},
"TextGenerateMultimodalMediaList": [
{
"Start": 1,
"End": 1,
"MultimodalMediaList": [
{
"Article": {
"SearchSourceName": "互联网搜索",
"Title": "xxxx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"MediaType": "image",
"FileUrl": "xx"
}
]
}
],
"GenerateFinished": true
},
"VideoSearchResult": {
"SearchResult": [
{
"Article": {
"SearchSourceName": "互联网搜索",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"ClipInfos": [
{
"Score": 0.8,
"From": 1,
"To": 1,
"Text": "xx",
"Type": "asr"
}
],
"FileUrl": "xx"
}
]
},
"ImageSearchResult": {
"SearchResult": [
{
"Article": {
"SearchSourceName": "互联网搜索",
"Title": "xx",
"Url": "xx",
"Summary": "xx",
"DocUuid": "xx",
"DocId": "xx"
},
"MediaId": "xx",
"FileUrl": "xx"
}
]
}
},
"SearchKeywords": [
"xx"
],
"SearchQueryList": [
"xx"
],
"RecommendSearchQueryList": [
"xx"
],
"SupplementDataType": "searchQuery",
"SupplementEnable": true
}
}
},
"Usage": {
"OutputTokens": 2,
"InputTokens": 1,
"TotalTokens": 3
}
},
"Header": {
"SessionId": "x",
"TraceId": "xx",
"TaskId": "x",
"OriginSessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
"Event": "task-failed",
"ErrorCode": "AccessForbid",
"ErrorMessage": "xx",
"EventInfo": "xx",
"ResponseTime": 1
},
"RequestId": "xx"
}
错误码
HTTP status code | 错误码 | 错误信息 | 描述 |
---|---|---|---|
403 | NoPermission | You are not authorized to perform this action. | 请检查workspaceId的赋值 |
访问错误中心查看更多错误码。