Agent Skills
› OpenDCAI/DataFlow-WebUI
› prompted-refiner
prompted-refiner
GitHubPromptedRefiner算子利用LLM对指定列的文本进行润色或重写,并直接覆盖原始数据。适用于需要批量优化、规范化或改写非结构化文本数据的场景。
Trigger Scenarios
需要对文本数据进行LLM润色或重写
使用算子流水线处理文本列
Install
npx skills add OpenDCAI/DataFlow-WebUI --skill prompted-refiner -g -y
SKILL.md
Frontmatter
{
"name": "prompted-refiner",
"description": "Reference documentation for the PromptedRefiner operator.\nUse when: refining text with LLM, overwriting original column."
}
PromptedRefiner Operator Reference
PromptedRefiner uses an LLM to refine/rewrite text in a column and overwrites the original column with refined results.
1. Import
from dataflow.operators.core_text import PromptedRefiner
2. Constructor
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 |
3. run() Signature
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) |
4. Usage Example
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()
5. Runtime Logic
- Read DataFrame from storage.
- Extract text from
input_keycolumn. - For each non-empty row, concatenate
system_prompt + textas LLM input. - Call LLM to generate refined text.
- Overwrite
input_keycolumn with refined results. - Empty/falsy rows are skipped (not sent to LLM).
- Return None.
6. Important Notes
- Overwrites
input_keycolumn in place (original text is lost) - To preserve original text, copy column first using PandasOperator
- Empty rows in
input_keyare skipped but remain in DataFrame - No
output_keyparameter exists
Version History
- 2e95d40 Current 2026-08-27 09:04


