Package net.stoerr.chatgpt.codevengine
Class ExecuteExternalAction
- java.lang.Object
-
- jakarta.servlet.GenericServlet
-
- jakarta.servlet.http.HttpServlet
-
- net.stoerr.chatgpt.codevengine.AbstractPluginAction
-
- net.stoerr.chatgpt.codevengine.ExecuteExternalAction
-
- All Implemented Interfaces:
jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
public class ExecuteExternalAction extends AbstractPluginAction
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected com.knuddels.jtokkit.api.Encoding
enc
Tokenizer used for GPT-4o*protected String
MIDDLE_MARKER
protected com.knuddels.jtokkit.api.EncodingRegistry
registry
-
Fields inherited from class net.stoerr.chatgpt.codevengine.AbstractPluginAction
BINARY_FILES_PATTERN, gitIgnoreRules, gson
-
-
Constructor Summary
Constructors Constructor Description ExecuteExternalAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doGet(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
Support that for debugging purposes, too.protected void
doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)
String
getUrl()
The URL it is deployed at, e.g.boolean
hasActions()
protected com.knuddels.jtokkit.api.IntArrayList
intArrayListFromList(List<Integer> tokens)
protected String
limitOutput(String output, int maxTokens)
Turns output to tokens and replaces the middle by if that's more than maxTokens.String
openApiDescription()
The OpenAPI description for this operation.-
Methods inherited from class net.stoerr.chatgpt.codevengine.AbstractPluginAction
abbreviate, findMatchingFiles, getBodyParameter, getMandatoryQueryParam, getPath, getQueryParam, getSimilarFilesMessage, gitIgnored, isIgnored, isNotEmpty, sendError
-
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
-
-
-
-
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*
-
MIDDLE_MARKER
protected final String MIDDLE_MARKER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getUrl
public String getUrl()
Description copied from class:AbstractPluginAction
The URL it is deployed at, e.g. /listFiles.- Specified by:
getUrl
in classAbstractPluginAction
-
openApiDescription
public String openApiDescription()
Description copied from class:AbstractPluginAction
The OpenAPI description for this operation.- Specified by:
openApiDescription
in classAbstractPluginAction
-
doPost
protected void doPost(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException
- Overrides:
doPost
in classjakarta.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 classjakarta.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()
-
-