Class ExecuteExternalAction

    • Field Detail

      • registry

        protected final com.knuddels.jtokkit.api.EncodingRegistry registry
      • enc

        protected final com.knuddels.jtokkit.api.Encoding enc
        Tokenizer used for GPT-4o*
    • Constructor Detail

      • ExecuteExternalAction

        public ExecuteExternalAction()
    • Method Detail

      • doPost

        protected void doPost​(jakarta.servlet.http.HttpServletRequest req,
                              jakarta.servlet.http.HttpServletResponse resp)
                       throws IOException
        Overrides:
        doPost in class jakarta.servlet.http.HttpServlet
        Throws:
        IOException
      • doGet

        protected void doGet​(jakarta.servlet.http.HttpServletRequest req,
                             jakarta.servlet.http.HttpServletResponse resp)
                      throws jakarta.servlet.ServletException,
                             IOException
        Support that for debugging purposes, too.
        Overrides:
        doGet in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • limitOutput

        protected String limitOutput​(String output,
                                     int maxTokens)
        Turns output to tokens and replaces the middle by if that's more than maxTokens.
      • intArrayListFromList

        protected com.knuddels.jtokkit.api.IntArrayList intArrayListFromList​(List<Integer> tokens)
      • hasActions

        public boolean hasActions()