prompt-engineering

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Prompt Engineering

提示词工程(Prompt Engineering)

Anatomía de un prompt

提示词的组成结构

  1. Rol y contexto
  2. Objetivo
  3. Restricciones
  4. Formato de output
  5. Ejemplos (few-shot)
  6. Edge cases
  1. 角色与上下文
  2. 目标
  3. 约束条件
  4. 输出格式
  5. 示例(few-shot)
  6. 边缘情况

Técnicas

常用技巧

  • Few-shot examples — para formato complejo
  • Chain-of-thought — para razonamiento
  • Structured outputs — JSON mode
  • RAG — retrieval-augmented generation
  • Few-shot示例 — 适用于复杂格式场景
  • Chain-of-thought — 用于推理任务
  • 结构化输出 — JSON模式
  • RAG — 检索增强生成(retrieval-augmented generation)

Temperatura

温度参数

ValorCuándo
0.0Clasificación, extracción
0.3Consistencia con variación
0.7Balance
1.0+Creatividad
数值使用场景
0.0分类、信息提取
0.3兼具一致性与少量变化
0.7平衡一致性与创造性
1.0+高创造性需求

Cuándo activarme

何时调用我

  • "Diseña el system prompt para..."
  • "El LLM no devuelve el formato correcto"
  • "¿Cómo implemento RAG?"
  • "为……设计system prompt"
  • "LLM未返回正确格式的结果"
  • "如何实现RAG?"