structured-tasks
Routes Promptify task construction, prompt building, parsing, async and batch execution, custom Pydantic schemas, and provider-side task failures.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- structured-tasks
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Routes Promptify task construction, prompt building, parsing, async and batch execution, custom Pydantic schemas, and provider-side task failures.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md4.9 KB
- 参考文档references/task-catalog.md2.7 KB
- 参考文档references/troubleshooting.md4.2 KB
- 参考文档references/workflows.md3.7 KB
03 SKILL.md 正文
Structured Tasks
Use this sub-skill when the user wants to create or run Promptify task objects, customize prompts, debug structured JSON output, or understand how task kwargs flow into the model and template layers.
Covered workflows
- NER, classification, QA, summarization, extraction, question generation, SQL generation, text normalization, topic extraction, and generic custom Task objects.
- Prompt rendering with built-in Jinja templates or custom template files.
- Parsing model output into Pydantic models, including fallback parsing when a provider does not return strict JSON.
- Sync, async, and batch task execution.
- Provider and LiteLLM failures such as auth, timeout, rate limit, and malformed response errors.
Read first
references/task-catalog.mdfor the built-in task families and their key arguments.references/api-reference.mdfor verified signatures and the split between model kwargs and template kwargs.references/workflows.mdfor practical recipes, mock-engine usage, async calls, and batch patterns.references/troubleshooting.mdfor provider, parse, template, and legacy-API mismatch errors.../../scripts/check_promptify.py --mode tasksfor a no-network smoke test.
Route boundaries
Include here
- Choosing the correct task class for a natural-language request.
- Supplying domain, labels, examples, schema, rules, max_length, key_points, num_questions, and num_topics.
- Building prompts with built-in or custom templates.
- Handling model kwargs such as temperature, top_p, max_tokens, stop, presence_penalty, frequency_penalty, timeout, and max_retries.
- Interpreting
ParserError,TemplateNotFoundError, and provider-level LiteLLM errors.
Exclude or route elsewhere
- Dataset loading, metric selection, ROUGE, and evaluator results go to
../evaluation/SKILL.md. - Repo maintenance or publication tasks do not belong here.
- Archived notebook or tutorial names such as Prompter, OpenAI, and Pipeline are not the current API.
Mental model
Promptify task objects are thin routers around a shared execution stack:
- A task class chooses a built-in template and output schema.
BaseTasksplits model kwargs from template kwargs.PromptBuilderrenders the prompt into OpenAI-style messages.LLMEnginesends the messages to LiteLLM.- The response is parsed into the requested Pydantic shape.
This sub-skill exists so future agents do not need to reopen the source code to remember that flow.
Use this route when the user asks for
- "Create a medical NER task with labels and examples"
- "Run QA with a custom question and domain"
- "Build a custom structured output schema"
- "Use batch mode or async with Promptify"
- "Fix a parser or template failure"
- "Understand which kwargs belong to the model and which belong to the template"
When to switch to evaluation
If the user asks about load_dataset, evaluate, exact match, accuracy, F1, precision, recall, or ROUGE, switch to the evaluation sub-skill instead of expanding this one.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).