3.2. 示例技能 YAML 规格


技能分享类似问题并回答布局,作为知识的 YAML 文件。在 RHEL AI 上,合成数据生成(SDG)进程使用您的 qna.yaml seed 示例为模型创建大量智能数据来了解,而不是完全依赖于用户生成的数据。

问题、答案和上下文对的顺序不会影响 SDG 或培训流程。有多种类型的技术被分成不同的类别:自由、基础技巧。您可以在以下示例中看到每个类别的示例:

自由格式组成技能示例 qna.yaml 文件

version: 2 
1

created_by: <user-name> 
2

task_description: 'Teach the model how to rhyme.' 
3

seed_examples:
  - question: What are 5 words that rhyme with horn? 
4

    answer: warn, torn, born, thorn, and corn. 
5

  - question: What are 5 words that rhyme with cat?
    answer: bat, gnat, rat, vat, and mat.
  - question: What are 5 words that rhyme with poor?
    answer: door, shore, core, bore, and tore.
  - question: What are 5 words that rhyme with bank?
    answer: tank, rank, prank, sank, and drank.
  - question: What are 5 words that rhyme with bake?
    answer: wake, lake, steak, make, and quake.

组成技术示例 qna.yaml 文件

version: 2 
1

created_by: <user-name> 
2

task_description: This skill provides the ability to read a markdown-formatted table. 
3

seed_examples:
  - context: | 
4

      | **Breed**      | **Size**     | **Barking** | **Energy** |
      |----------------|--------------|-------------|------------|
      | Afghan Hound   | 25-27 in     | 3/5         | 4/5        |
      | Labrador       | 22.5-24.5 in | 3/5         | 5/5        |
      | Cocker Spaniel | 14.5-15.5 in | 3/5         | 4/5        |
      | Poodle (Toy)   | <= 10 in     | 4/5         | 4/5        |
    question: | 
5

      Which breed has the most energy?
    answer: | 
6

      The breed with the most energy is the Labrador.
  - context: |
      | **Name** | **Date** | **Color** | **Letter** | **Number** |
      |----------|----------|-----------|------------|------------|
      | George   | Mar 5    | Green     | A          | 1          |
      | Gráinne  | Dec 31   | Red       | B          | 2          |
      | Abigail  | Jan 17   | Yellow    | C          | 3          |
      | Bhavna   | Apr 29   | Purple    | D          | 4          |
      | Rémy     | Sep 9    | Blue      | E          | 5          |
    question: |
      What is Gráinne's letter and what is her color?
    answer: |
      Gráinne's letter is B and her color is red.
  - context: |
      | Banana | Apple      | Blueberry | Strawberry |
      |--------|------------|-----------|------------|
      | Yellow | Red, Green | Blue      | Red        |
      | Large  | Medium     | Small     | Small      |
      | Peel   | Peel       | No peel   | No peel    |
    question: |
      Which fruit is blue, small, and has no peel?
    answer: |
      The blueberry is blue, small, and has no peel.

1 1
指定技术 qna.yaml 格式的版本。
2 2
指定名称或 git username。
3 3
指定您的技术及其功能的描述。
4
指定包含模型执行技能所需的信息的额外上下文。实践技能需要.
4 5
为模型指定一个问题。
5 6
指定来自模型所需的响应。
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部