From d5881bc2cca3414adb374877c7a0458d05aa6022 Mon Sep 17 00:00:00 2001 From: Hans-Peter Stoerr Date: Fri, 1 Dec 2023 08:04:40 +0100 Subject: [PATCH] reduce token number again as 2000 tokens leaves too little room for the page --- .../java/com/composum/ai/backend/slingbase/AICreateServlet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/slingbase/src/main/java/com/composum/ai/backend/slingbase/AICreateServlet.java b/backend/slingbase/src/main/java/com/composum/ai/backend/slingbase/AICreateServlet.java index 9e43e1cff..9502a8040 100644 --- a/backend/slingbase/src/main/java/com/composum/ai/backend/slingbase/AICreateServlet.java +++ b/backend/slingbase/src/main/java/com/composum/ai/backend/slingbase/AICreateServlet.java @@ -254,7 +254,7 @@ protected void doPost(@NotNull SlingHttpServletRequest request, @NotNull SlingHt GPTConfiguration mergedConfig = GPTConfiguration.ofRichText(richtext).merge(config); Integer maxTokensParam = getOptionalInt(request, response, PARAMETER_MAXTOKENS); - int maxtokens = maxTokensParam != null ? maxTokensParam : 2000; // some arbitrary default + int maxtokens = maxTokensParam != null ? maxTokensParam : 1000; // some arbitrary default if (isNotBlank(textLength)) { Matcher matcher = Pattern.compile("\\s*(\\d+)\\s*\\|\\s*(.*)").matcher(textLength); if (matcher.matches()) { // maxtokens can be encoded into textLength, e.g. "1000|Several paragraphs of text"