dialog_topic_detection_mapper¶
Generates user’s topic labels and analysis in a dialog.
This operator processes a dialog to detect and label the topics discussed by the user. It takes input from history_key
, query_key
, and response_key
and outputs lists of labels and analysis for each query in the dialog. The operator uses a predefined system prompt and templates to build the input prompt for the API call. It supports customizing the system prompt, templates, and patterns for parsing the API response. The results are stored in the meta
field under the keys specified by labels_key
and analysis_key
. If these keys already exist in the meta
field, the operator skips processing. The operator retries the API call up to try_num
times in case of errors.
在对话中生成用户的话题标签和分析。
该算子处理对话以检测并标记用户讨论的话题。它从history_key
、query_key
和response_key
获取输入,并为对话中的每个查询输出标签和分析列表。该算子使用预定义的系统提示和模板来构建API调用的输入提示。它支持自定义系统提示、模板和模式以解析API响应。结果存储在meta
字段下的labels_key
和analysis_key
指定的键下。如果这些键已经存在于meta
字段中,该算子将跳过处理。该算子在出现错误时最多重试try_num
次API调用。
Type 算子类型: mapper
Tags 标签: cpu, api
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
---|---|---|---|
|
<class ‘str’> |
|
API model name. |
|
typing.Optional[typing.List[str]] |
|
The output topic candidates. Use |
|
typing.Annotated[int, Ge(ge=0)] |
|
The max num of round in the dialog to build the |
|
<class ‘str’> |
|
The key name in the meta field to store the |
|
<class ‘str’> |
|
The key name in the meta field to store the |
|
typing.Optional[str] |
|
URL endpoint for the API. |
|
typing.Optional[str] |
|
Path to extract content from the API response. |
|
typing.Optional[str] |
|
System prompt for the task. |
|
typing.Optional[str] |
|
Template for query part to build the input |
|
typing.Optional[str] |
|
Template for response part to build the |
|
typing.Optional[str] |
|
Template for topic candidates to |
|
typing.Optional[str] |
|
Template for analysis part to build the |
|
typing.Optional[str] |
|
Template for labels part to build the |
|
typing.Optional[str] |
|
Pattern to parse the return topic |
|
typing.Optional[str] |
|
Pattern to parse the return topic |
|
typing.Annotated[int, Gt(gt=0)] |
|
The number of retry attempts when there is an API |
|
typing.Dict |
|
Parameters for initializing the API model. |
|
typing.Dict |
|
Extra parameters passed to the API call. |
|
|
Extra keyword arguments. |
📊 Effect demonstration 效果演示¶
not available 暂无