一键导入
prompted-refiner
Reference documentation for the PromptedRefiner operator. Use when: refining text with LLM, overwriting original column.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reference documentation for the PromptedRefiner operator. Use when: refining text with LLM, overwriting original column.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
DataFlow 开发专家上下文加载器。当用户在 DataFlow 仓库中进行开发时触发, 涵盖:新建算子/Pipeline/Prompt、诊断报错、规范审查、 以及感知仓库变更并建议更新知识库。 Trigger: user is developing in DataFlow repo, asks to create operator/pipeline/prompt, encounters errors, wants code review, or asks about operators.
Reasoning-guided pipeline planner that generates standard DataFlow pipeline code
Reference documentation for the BenchDatasetEvaluatorQuestion operator. Extended version of BenchDatasetEvaluator with question and subquestion support. Use when: evaluating answers with question context or multiple subquestions.
Reference documentation for the BenchDatasetEvaluator operator. Covers the constructor, two comparison modes (match/semantic), and pipeline usage. Use when: comparing predicted answers against ground truth answers in benchmark evaluation.
Reference documentation for the PromptedEvaluator operator. Use when: scoring text quality with LLM without filtering rows.
Reference documentation for the Text2QASampleEvaluator operator. Use when: evaluating QA pair quality across multiple dimensions.
| name | prompted-refiner |
| description | Reference documentation for the PromptedRefiner operator. Use when: refining text with LLM, overwriting original column. |
| trigger_keywords | ["PromptedRefiner","prompted-refiner","text refinement","LLM rewriting"] |
| version | 1.0.0 |
PromptedRefiner uses an LLM to refine/rewrite text in a column and overwrites the original column with refined results.
from dataflow.operators.core_text import PromptedRefiner
PromptedRefiner(
llm_serving=llm_serving,
system_prompt="You are a helpful agent.",
)
| Parameter | Required | Default | Description |
|---|---|---|---|
llm_serving | Yes | None | LLM service object |
system_prompt | No | "You are a helpful agent." | Instruction for text refinement |
op.run(
storage=self.storage.step(),
input_key="raw_content",
)
# returns: None
| Parameter | Required | Default | Description |
|---|---|---|---|
storage | Yes | None | Storage step object |
input_key | No | "raw_content" | Column to refine (overwritten in place) |
from dataflow.operators.core_text import PromptedRefiner
from dataflow.serving import APILLMServing_request
from dataflow.utils.storage import FileStorage
class MyPipeline:
def __init__(self):
self.storage = FileStorage(
first_entry_file_name="./data/input.jsonl",
cache_path="./cache",
file_name_prefix="step",
cache_type="jsonl"
)
self.llm_serving = APILLMServing_request(
api_url="https://api.openai.com/v1/chat/completions",
key_name_of_api_key="DF_API_KEY",
model_name="gpt-4o",
max_workers=10
)
self.refiner = PromptedRefiner(
llm_serving=self.llm_serving,
system_prompt="Refine the following text for clarity."
)
def forward(self):
self.refiner.run(
storage=self.storage.step(),
input_key="content"
)
if __name__ == "__main__":
pipeline = MyPipeline()
pipeline.forward()
input_key column.system_prompt + text as LLM input.input_key column with refined results.input_key column in place (original text is lost)input_key are skipped but remain in DataFrameoutput_key parameter exists