dialog_intent_detection_mapper¶
Generates user’s intent labels in a dialog by analyzing the history, query, and response.
This operator processes a dialog to identify and label the user’s intent. It uses a predefined system prompt and templates to build input prompts for an API call. The API model (e.g., GPT-4) is used to analyze the dialog and generate intent labels and analysis. The results are stored in the meta field under ‘dialog_intent_labels’ and ‘dialog_intent_labels_analysis’. The operator supports customizing the system prompt, templates, and patterns for parsing the API response. If the intent candidates are provided, they are included in the input prompt. The operator retries the API call up to a specified number of times if there are errors.
通过分析历史记录、查询和响应,在对话中生成用户的意图标签。
此算子处理对话以识别并标记用户的意图。它使用预定义的系统提示和模板构建API调用的输入提示。使用API模型(例如GPT-4)分析对话并生成意图标签和分析。结果存储在元字段下的’dialog_intent_labels’和’dialog_intent_labels_analysis’中。算子支持自定义系统提示、模板和解析API响应的模式。如果提供了意图候选,则将其包含在输入提示中。如果出现错误,算子将重试API调用最多指定次数。
Type 算子类型: mapper
Tags 标签: cpu, api
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
---|---|---|---|
|
<class ‘str’> |
|
API model name. |
|
typing.Optional[typing.List[str]] |
|
The output intent candidates. Use the |
|
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 intent candidates to |
|
typing.Optional[str] |
|
Template for analysis part to build the |
|
typing.Optional[str] |
|
Template for labels to build the |
|
typing.Optional[str] |
|
Pattern to parse the return intent |
|
typing.Optional[str] |
|
Pattern to parse the return intent |
|
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 暂无