close

Filter

loading table of contents...

Solution Overview for Business Users / Version 2512.0

Table Of Contents

12.3.3 Tips for Writing Good Playbooks

  • Be prepared for some trial and error

    First and foremost: Don't be afraid to experiment! Prompt engineering (and writing playbooks is exactly that) is a bit of a trial-and-error process. You might have to write a few playbooks before you get the hang of it. Don't give up too early! Usually, you will get KIO to do what you want it to do, but it might take a few iterations.

  • Be specific, but not too specific

    The more specific you are in your playbook, the less likely KIO is to misunderstand you. For example, if you want KIO to only ever update the htmlTitle property, say so explicitly. However, you can also rely on KIO to infer the correct things from the context and by making use of its toolkit: For example, you can also be a bit more vague and write "update all properties that hold SEO metadata. Look at the property names to infer what they are".

  • Give examples

    One shot prompting or few shot prompting have proven to be good techniques to improve KIO's accuracy in interacting with the content repository. Therefore, it's a good idea to give one (or a few) example(s), especially for complex tasks. For example, when you want KIO to update a complex property such as Markup or Struct, it has proven to be efficient to just give KIO an example XML snippet that it can use as a template. For example, the playbook snippet below has shown to work well:

    (...)
    * Modify the property `variants` of this new content item, like this:
    * Consider this example xml:
    
    <Struct xmlns='http://www.coremedia.com/2008/struct' xmlns:xlink='http://www.w3.org/1999/xlink'>
      <StructProperty Name='mappings'>
        <Struct>
          <StructProperty Name='variant-7c8a525e-3649-4fb9-8534-31cc3c5da5ba'>
            <Struct>
              <StringProperty Name='segmentId' Length='255'>cmec:///p13n/segment/78206;cmecType=segment</StringProperty>
              <LinkProperty Name='target' LinkType='coremedia:///cap/contenttype/CMTeasable' xlink:href='coremedia:///cap/content/7302'/>
            </Struct>
          </StructProperty>
          <StructProperty Name='variant-a3b7371c-6300-48a7-9c33-13933f6a407b'>
            <Struct>
              <StringProperty Name='segmentId' Length='255'>cmec:///p13n/segment/78204;cmecType=segment</StringProperty>
              <LinkProperty Name='target' LinkType='coremedia:///cap/contenttype/CMTeasable' xlink:href='coremedia:///cap/content/6522'/>
            </Struct>
          </StructProperty>
        </Struct>
      </StructProperty>
      <BooleanProperty Name='kioModified'>true</BooleanProperty>
    </Struct>
    
    * Construct an XML string exactly like this (including the whitespace), except:
    * In the LinkProperty attribute xlink:href, replace the value with the link to the content item you
      created in the previous step. Hint: Change the ID to the ID of the content items you copied.
    * In the StringProperty body, replace the cmec: link with the segment ID you found in the previous
      steps for the respective segment. Always use the numerical segment ID, not the name.
  • Be very explicit when explaining paths and folders

    Humans often have a hard time parsing complex folder structures, and surprisingly, it turns out that KIO sometimes gets confused with that, too. Therefore, it has shown to be good practice to be super-precise when explaining paths and folders. The example playbook snippet below has proven to work well:

    Look at the repository path closely. It is always structured like this:
    `/Sites/<Site Name>/<Country Name>/<Language>/<Folder1>/<Folder2>/.../<Content Item Name>`.
    Now, create a copy of the source content. You must place the copy in the same folder as the original
    content. For example, when the path of the original content item is
    `/Sites/MySite/United States/English/Editorial/Homepage/Blog/My Blog Post`, and you are asked to
    translate to German, the target path would be
    `/Sites/MySite/United States/English/Editorial/Homepage/Blog/My Blog Post - DE`.
  • Stay up to date on prompt engineering best practices

    Prompt engineering is a relatively new field, and best practices are still evolving. It's a good idea to stay up to date on the latest research and best practices. Good starting points are Prompting Guide, or, in the case of OpenAI, the OpenAI Prompt Engineering guidelines.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.