calibrate_response_mapper¶
Calibrate response in question-answer pairs based on reference text.
This mapper calibrates the ‘response’ part of a question-answer pair by using a reference text. It aims to make the response more detailed and accurate while ensuring it still answers the original question. The calibration process uses a default system prompt, which can be customized. The output is stripped of any leading or trailing whitespace.
基于参考文本校准问答对中的响应。
该映射器通过使用参考文本来校准问答对中的“响应”部分。它的目标是使响应更加详细和准确,同时确保它仍然能够回答原始问题。校准过程使用默认的系统提示,该提示可以自定义。输出去除了任何前导或尾随空白。
Type 算子类型: mapper
Tags 标签: cpu, api
🔧 Parameter Configuration 参数配置¶
name 参数名 |
type 类型 |
default 默认值 |
desc 说明 |
---|---|---|---|
|
<class ‘str’> |
|
API model name. |
|
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 calibration task. |
|
typing.Optional[str] |
|
Template for building the model input. |
|
typing.Optional[str] |
|
Template for formatting the reference text. |
|
typing.Optional[str] |
|
Template for formatting question-answer pairs. |
|
typing.Optional[str] |
|
Regular expression for parsing model output. |
|
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 暂无