mirror of
https://github.com/ONLYOFFICE/onlyoffice.github.io.git
synced 2026-02-10 18:05:06 +08:00
Fix bugs
This commit is contained in:
@ -1188,7 +1188,8 @@
|
||||
|
||||
|
||||
const topic = params.topic || "Untitled presentation";
|
||||
const userSlideCount = (Number.isFinite(params.slideCount) && params.slideCount > 0) ? Math.floor(params.slideCount) : null;
|
||||
let intSlideCount = parseInt(params.slideCount, 10);
|
||||
const userSlideCount = (Number.isFinite(intSlideCount) && intSlideCount > 0) ? intSlideCount : null;
|
||||
const style = params.style || "modern";
|
||||
|
||||
const additionalConstrait = userSlideCount !== null ? `- You have a HARD CAP of ${userSlideCount} slide blocks: output exactly ${userSlideCount} {"t":"slide.start"}...{"t":"slide.end"} pairs.` : ``;
|
||||
|
||||
@ -74,9 +74,19 @@ class Provider extends AI.Provider {
|
||||
return super.getEndpointUrl(endpoint, model);
|
||||
}
|
||||
|
||||
getRequestBodyOptions() {
|
||||
getRequestBodyOptions(body) {
|
||||
let max_output_tokens = 64000;
|
||||
if (body.model) {
|
||||
if (body.model.indexOf("-4-") != -1 || body.model.indexOf("-4-1-") != -1) {
|
||||
max_output_tokens = 32000;
|
||||
}
|
||||
else if (body.model.indexOf("-3-5-") != -1) {
|
||||
max_output_tokens = 8096;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
max_tokens : 4096
|
||||
max_tokens : max_output_tokens
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ class Provider extends AI.Provider {
|
||||
super("GPT4All", "http://localhost:4891", "", "v1");
|
||||
}
|
||||
|
||||
getRequestBodyOptions() {
|
||||
getRequestBodyOptions(body) {
|
||||
return {
|
||||
max_tokens : 4096
|
||||
};
|
||||
|
||||
@ -148,7 +148,7 @@
|
||||
* Don't override this method unless you know what you're doing.
|
||||
* @returns {Object}
|
||||
*/
|
||||
getRequestBodyOptions() {
|
||||
getRequestBodyOptions(body) {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@ -2873,7 +2873,8 @@ HELPERS.slide.push((function(){
|
||||
|
||||
|
||||
const topic = params.topic || "Untitled presentation";
|
||||
const userSlideCount = (Number.isFinite(params.slideCount) && params.slideCount > 0) ? Math.floor(params.slideCount) : null;
|
||||
let intSlideCount = parseInt(params.slideCount, 10);
|
||||
const userSlideCount = (Number.isFinite(intSlideCount) && intSlideCount > 0) ? intSlideCount : null;
|
||||
const style = params.style || "modern";
|
||||
|
||||
const additionalConstrait = userSlideCount !== null ? `- You have a HARD CAP of ${userSlideCount} slide blocks: output exactly ${userSlideCount} {"t":"slide.start"}...{"t":"slide.end"} pairs.` : ``;
|
||||
|
||||
Reference in New Issue
Block a user