Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

As you can see, you can send a prompt to the AI using the command ai.agent.call. This command can be called with ad-hoc data or by refering to a reusable agent template. For more information about the full power of AI Agents in PIPEFORCE, see AI Agents.

...

Code Block
languageyaml
pipeline:
  - ai.agent.call:
      input: $uri:drive:invoice-3662.pdf
      prompt: |
        Check the invoice to ensure it is correct both in terms 
        of content and calculations. If everything is fine, return "OK". 
        If not, provide the reason for the error in one sentence.

...

Convert data with a prompt

You can also convert from one data structure into another using a prompt.

See this example which converts a given XML input to JSON:

Code Block
languageyaml
pipeline:
  - ai.agent.call:
      input: |
        <person>
          <firstName>Max</firstName>
          <lastName>Smith</lastName>
          <age>36</age>
        </person>
      prompt: "Convert to JSON"

...

Code Block
languagejson
{
    "person": {
        "firstName": "Max",
        "lastName": "Smith",
        "age": 36
    }
}

...

Filter data using a prompt

You can also use a prompt as a data filter.

Here is an example which uses a data privacy filter:

Code Block
languageyaml
pipeline:
  - ai.agent.call:
      input: |
        {
          "person": {
            "firstName": "Max",
            "lastName": "Smith",
            "age": 36
          }
        }
      prompt: |
          Remove all personal data because of privacy and 
          replace by randomized names and add prefix p_

...

Code Block
languagejson
{
    "person": {
        "firstName": "p_Alex",
        "lastName": "p_Johnson",
        "age": 48
    }
}

...

Using variables in a prompt

You can make prompts more dynamically by using variables.

...