Skip to content

Commit

Permalink
reduce token number again as 2000 tokens leaves too little room for t…
Browse files Browse the repository at this point in the history
…he page
  • Loading branch information
stoerr committed Dec 1, 2023
1 parent ad39a53 commit d5881bc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d5881bc

Please sign in to comment.