version: 1.0.0
sections:
    main:
      - ai:
          # post_prompt_url - string
          # URL to post the conversation to after it ended
          # Supports https://user:pass@server.com format
          # DEFAULT: undef
          post_prompt_url: http://some.server.com/rest/post.cgi

          # params - object
          # Params to change behaviors in the ai app
          # DEFAULT: undef
          params:
            # conscience - boolen or string
            # Enable conscience which enforces prompts more strictly
            # DEFAULT: true for system conscience or an explicit string.
            # The conscience is appended to the conversation using the system role before sending it to the ai model but is not permenantly added to the conversation so that its always the last line in the conversation 
            conscience: true

          #
          # prompt - object (REQUIRED)
          # Main prompt to send to the assistant to define its
          # behavior.
          # DEFAULT: undef
          prompt:
            # top_p - percent as decimal
            # Probability mass (top X percent of probable tokens)
            # See https://platform.openai.com/docs/api-reference/chat/create#chat/create-top_p
            # DEFAULT: 1.0 (100%)
            top_p: 1.0

            # temperature - decimal 0.0 - 2.0
            # Higher the value the more random and the lower the more deterministic the output is.
            # see https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
            # DEFAULT: 0.3
            temperature: 0.3

            # frequency_penalty - decimal -2.0 - 2.0
            # Positive values penalize new tokens based on their
            # existing frequency in the text so far, decreasing the
            # model's likelihood to repeat the same line verbatim. 
            # See https://platform.openai.com/docs/api-reference/chat/create#chat/create-frequency_penalty  
            # DEFAULT: 0.1
            frequency_penalty: 0.1

            # presence_penalty - decimal -2.0 - 2.0
            # Positive values penalize new tokens based on whether
            # they appear in the text so far, increasing the model's
            # likelihood to talk about new topics.
            # See https://platform.openai.com/docs/api-reference/chat/create#chat/create-presence_penalty
            # DEFAULT: 0.1
            presence_penalty: 0.1

            # text - string (REQUIRED)
            # The text of the prompt. This is the main instruction
            # prompt to prep the AI assistant with its personality and behaviors.
            # DEFAULT: undef
            text: >-
              You name is Franklin and you are an expert at Star Wars.
              Introduce yourself and see if I have any questions.
          #
          # post_prompt - object
          # At the end of the conversation if post_prompt and post_prompt_url
          # are set, the entire transcript is
          # sent to the AI one last time and this prompt lets you
          # extract data, summarize the convo, or anything else you
          # want to do. The whole conversation log, along with the
          # result of this post_prompt will be posted to post_prompt_url
          # DEFAULT: undef
          post_prompt:
            # top_p - percent as decimal
            # Probability mass (top X percent of probable tokens)
            # See https://platform.openai.com/docs/api-reference/chat/create#chat/create-top_p
            # DEFAULT: 1.0 (100%)
            top_p: 1.0;

            # temperature - decimal 0.0 - 2.0
            # Higher the value the more random and the lower the more deterministic the output is.
            # see https://platform.openai.com/docs/api-reference/chat/create#chat/create-temperature
            # DEFAULT: 0.3
            temperature: 0.3

            # frequency_penalty - decimal -2.0 - 2.0
            # Positive values penalize new tokens based on their
            # existing frequency in the text so far, decreasing the
            # model's likelihood to repeat the same line verbatim. 
            # See https://platform.openai.com/docs/api-reference/chat/create#chat/create-frequency_penalty  
            # DEFAULT: 0.1
            frequency_penalty: 0.0

            # presence_penalty - decimal -2.0 - 2.0
            # Positive values penalize new tokens based on whether
            # they appear in the text so far, increasing the model's
            # likelihood to talk about new topics.
            # See https://platform.openai.com/docs/api-reference/chat/create#chat/create-presence_penalty
            # DEFAULT: 0.0
            presence_penalty: 0.0

            # text - string (REQUIRED)
            # The text of the prompt. This instruction is sent to the
            # AI to POST-PROCESS the conversation and draw one final conclusion.
            # DEFAULT: undef
            text: >-
              Please summarize the conversation
          #
          # SWAIG - array of objects
          # SignalWire AI Gateway
          # A set of functions that allow the AI to use your tools to
          # get real-time info from the real world.
          # The SWAIG section contains and object of defaults and an array of functions.
          # Each object in the functions array has the following params:
          # function - a unique function name
          # argument - a description of the input to the function
          # purpose - a string describing the context and purpose so the model knows when to use the function.
          # web_hook_url - the url to post the data to when executing (may contain user:pass@)
          # web_hook_auth_user - the username in the basic auth. (ignored when user:pass is in url)
          # web_hook_auth_pass - the passwored for the basic auth (ignored when user:pass is in url)
          # meta_data_token - scoping token for meta_data, if not supplied will be scoped to function's web_hook_url
          # meta_data - any data you want to push through to the webhook.
          #
          # The defaults object provides defaults for web_hook_url, web_hook_auth_user, web_hook_auth_pass or meta_data.
          #
          SWAIG:
            defaults:
              web_hook_url: https://user:pass@somewhere.com/weather.cgi
            functions:
              - function: get_weather
                purpose: To determine what the current weather is in a provided location.
                argument:
                  type: object
                  properties:
                     location:
                       type: string
                       description: the location to check the weather in
                       
