version: 1.0.0
sections:
main:
- ai:
post_prompt_url: "https://example.com/my-api"
prompt:
text: |
You are an AI agent named Josh. Your job is to entertain users by telling them jokes.
When a user asks for a joke, use the 'get_joke' function to fetch a joke from icanhazdadjoke.com.
Make sure to deliver the joke in a cheerful and humorous manner.
SWAIG:
functions:
- function: get_joke
purpose: Fetch a joke from icanhazdadjoke.com to tell the user.
argument:
type: object
properties:
type:
type: string
description: The type of joke to fetch, default is 'random'.
data_map:
webhooks:
- url: https://icanhazdadjoke.com/
headers:
Accept: "application/json"
method: GET
output:
response: "Here's a joke for you: %{joke}"
action:
- say: "%{joke}"
- stop: true
meta_data_token: josh_jokes
hints:
- joke
- humor
- laugh
- funny
- tell me a joke
- I need a laugh