Agent SkillsOpenDCAI/DataFlow-WebUI › prompted-generator

prompted-generator

GitHub

PromptedGenerator算子参考文档,涵盖构造函数、run方法及数据流集成细节。用于在DataFlow管道中实现单字段LLM生成,处理DataFrame行级文本输入与批量调用。

skills/canonical/core_text/generate/prompted-generator/SKILL.md OpenDCAI/DataFlow-WebUI

Trigger Scenarios

集成PromptedGenerator到DataFlow管道 查询LLM生成算子的参数配置 理解单字段文本生成的执行逻辑

Install

npx skills add OpenDCAI/DataFlow-WebUI --skill prompted-generator -g -y
More Options

Non-standard path

npx skills add https://github.com/OpenDCAI/DataFlow-WebUI/tree/main/skills/canonical/core_text/generate/prompted-generator -g -y

Use without installing

npx skills use OpenDCAI/DataFlow-WebUI@prompted-generator

指定 Agent (Claude Code)

npx skills add OpenDCAI/DataFlow-WebUI --skill prompted-generator -a claude-code -g -y

安装 repo 全部 skill

npx skills add OpenDCAI/DataFlow-WebUI --all -g -y

预览 repo 内 skill

npx skills add OpenDCAI/DataFlow-WebUI --list

SKILL.md

Frontmatter
{
    "name": "prompted-generator",
    "description": "Reference documentation for the PromptedGenerator operator. Covers constructor parameters, run() signature, actual row-processing behavior, and pipeline usage notes. Use when: integrating PromptedGenerator into a DataFlow pipeline for single-field LLM generation."
}

PromptedGenerator Operator Reference

PromptedGenerator is DataFlow's basic single-field LLM generation operator.

For each row in the current DataFrame, it reads the value from input_key. If that value is truthy, it builds one LLM input as:

user_prompt + str(row[input_key])

It then calls llm_serving.generate_from_input(...) in batch and writes the generated results into output_key.

1. Import

from dataflow.operators.core_text import PromptedGenerator

2. Constructor

PromptedGenerator(
    llm_serving,                               # required
    system_prompt="You are a helpful agent.",  # optional
    user_prompt="",                            # optional
    json_schema=None,                          # optional
)
Parameter Required Default Description
llm_serving Yes None LLM service object implementing generate_from_input(...)
system_prompt No "You are a helpful agent." System prompt passed to the serving layer
user_prompt No "" Prefix prepended directly before each valid row's input text
json_schema No None Optional schema forwarded to the serving layer

3. run() Signature

op.run(
    storage=self.storage.step(),
    input_key="raw_content",
    output_key="generated_content",
)
# returns: output_key
Parameter Required Default Description
storage Yes None Current operator-step storage object
input_key No "raw_content" Column read from the current DataFrame
output_key No "generated_content" Column written back to the DataFrame

4. Actual Execution Logic

The operator performs the following steps:

  1. Read the current DataFrame from storage.
  2. Iterate over the DataFrame row by row.
  3. For each row, read raw_content = row.get(input_key, "").
  4. Only if raw_content is truthy, append user_prompt + str(raw_content) to the batch LLM input list.
  5. Call:
llm_serving.generate_from_input(
    user_inputs=llm_inputs,
    system_prompt=system_prompt,
    json_schema=json_schema,
)
  1. Write the generated list into dataframe[output_key].
  2. Persist the updated DataFrame through storage.write(dataframe).
  3. Return output_key.

5. Important Rules

  1. input_key must exist in the current DataFrame.
  2. user_prompt is a plain string prefix, not a template engine.
  3. The implementation skips rows whose input_key value is empty, None, or otherwise falsy when building LLM inputs.

6. Typical Usage

from dataflow.operators.core_text import PromptedGenerator

prompted_gen = PromptedGenerator(
    llm_serving=self.llm_serving,
    system_prompt="You are a helpful agent.",
    user_prompt="Summarize the following content in one sentence:\n",
)

prompted_gen.run(
    storage=self.storage.step(),
    input_key="raw_content",
    output_key="summary",
)

7. Return Value

return output_key

This is intended for downstream operator chaining.

Version History

  • 2e95d40 Current 2026-08-27 09:04

Same Skill Collection

skills/canonical/core_text/eval/bench-dataset-evaluator-question/SKILL.md
skills/canonical/core_text/eval/bench-dataset-evaluator/SKILL.md
skills/canonical/core_text/eval/prompted-evaluator/SKILL.md
skills/canonical/core_text/eval/text2qa-sample-evaluator/SKILL.md
skills/canonical/core_text/eval/unified-bench-dataset-evaluator/SKILL.md
skills/canonical/core_text/filter/general-filter/SKILL.md
skills/canonical/core_text/filter/kcentergreedy-filter/SKILL.md
skills/canonical/core_text/filter/prompted-filter/SKILL.md
skills/canonical/core_text/generate/bench-answer-generator/SKILL.md
skills/canonical/core_text/generate/chunked-prompted-generator/SKILL.md
skills/canonical/core_text/generate/embedding-generator/SKILL.md
skills/canonical/core_text/generate/format-str-prompted-generator/SKILL.md
skills/canonical/core_text/generate/retrieval-generator/SKILL.md
skills/canonical/core_text/generate/text2multihopqa-generator/SKILL.md
skills/canonical/core_text/refine/pandas-operator/SKILL.md
skills/canonical/core_text/refine/prompted-refiner/SKILL.md
skills/canonical/core_text/SKILL.md
skills/canonical/dataflow-dev/SKILL.md
skills/canonical/dataflow-operator-builder/SKILL.md
skills/canonical/generating-dataflow-pipeline/SKILL.md
skills/canonical/prompt-template-builder/SKILL.md
skills/canonical/core_text/generate/random-domain-knowledge-row-generator/SKILL.md

Metadata

Files
0
Version
2e95d40
Hash
8aed2b14
Indexed
2026-08-27 09:04

Accueil - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-27 15:46
浙ICP备14020137号-1 $Carte des visiteurs$