Skip to content

Writing Inline Functions for Invokers

Prompty allows writing inline functions for invokers to extend functionality.

Refer to the functions.prompty file for more examples.

YAML
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
name: Inline Function Prompt
description: A prompt that uses inline functions for invokers
authors:
  - example_author
model:
  api: chat
  configuration:
    azure_deployment: gpt-35-turbo
  parameters:
    tools:
    - type: function
      function:
        name: custom_function
        description: A custom inline function
        parameters:
          properties:
            input:
              description: Input data for the function
              type: string
          required:
          - input
          type: object
sample:
  input: "example input data"
---
system:
You are an AI assistant that uses custom functions.
user:
Please process the following input using the custom function: {{input}}