mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-07 08:35:51 +00:00
Update cwb_apiService.js
This commit is contained in:
@@ -92,7 +92,7 @@ async function callCwbSillyTavernPreset(messages, options) {
|
|||||||
responsePromise = context.ConnectionManagerRequestService.sendRequest(
|
responsePromise = context.ConnectionManagerRequestService.sendRequest(
|
||||||
targetProfile.id,
|
targetProfile.id,
|
||||||
messages,
|
messages,
|
||||||
options.maxTokens || 100000
|
options.maxTokens || 65000
|
||||||
);
|
);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
@@ -133,7 +133,7 @@ async function callCwbOpenAITest(messages, options) {
|
|||||||
frequency_penalty: 0,
|
frequency_penalty: 0,
|
||||||
group_names: [],
|
group_names: [],
|
||||||
include_reasoning: false,
|
include_reasoning: false,
|
||||||
max_tokens: options.maxTokens || 100000,
|
max_tokens: options.maxTokens || 65000,
|
||||||
messages: messages,
|
messages: messages,
|
||||||
model: options.model,
|
model: options.model,
|
||||||
presence_penalty: 0.12,
|
presence_penalty: 0.12,
|
||||||
@@ -160,7 +160,7 @@ export async function callCwbAPI(systemPrompt, userPromptContent, options = {})
|
|||||||
const apiSettings = getCwbApiSettings();
|
const apiSettings = getCwbApiSettings();
|
||||||
|
|
||||||
const finalOptions = {
|
const finalOptions = {
|
||||||
maxTokens: 100000,
|
maxTokens: 65000,
|
||||||
temperature: 1,
|
temperature: 1,
|
||||||
model: apiSettings.model,
|
model: apiSettings.model,
|
||||||
apiUrl: apiSettings.apiUrl,
|
apiUrl: apiSettings.apiUrl,
|
||||||
@@ -460,7 +460,7 @@ export async function callCustomOpenAI(systemPrompt, userPromptContent) {
|
|||||||
{ role: 'system', content: combinedSystemPrompt },
|
{ role: 'system', content: combinedSystemPrompt },
|
||||||
{ role: 'user', content: userPromptContent },
|
{ role: 'user', content: userPromptContent },
|
||||||
];
|
];
|
||||||
return await callCwbSillyTavernPreset(messages, { tavernProfile: apiSettings.tavernProfile, maxTokens: 100000 });
|
return await callCwbSillyTavernPreset(messages, { tavernProfile: apiSettings.tavernProfile, maxTokens: 65000 });
|
||||||
} else {
|
} else {
|
||||||
if (!state.customApiConfig.url || !state.customApiConfig.model) {
|
if (!state.customApiConfig.url || !state.customApiConfig.model) {
|
||||||
throw new Error('API URL/Model未配置。');
|
throw new Error('API URL/Model未配置。');
|
||||||
@@ -478,7 +478,7 @@ export async function callCustomOpenAI(systemPrompt, userPromptContent) {
|
|||||||
frequency_penalty: 0,
|
frequency_penalty: 0,
|
||||||
presence_penalty: 0.12,
|
presence_penalty: 0.12,
|
||||||
top_p: 1,
|
top_p: 1,
|
||||||
max_tokens: 100000,
|
max_tokens: 65000,
|
||||||
stream: false,
|
stream: false,
|
||||||
chat_completion_source: 'openai',
|
chat_completion_source: 'openai',
|
||||||
group_names: [],
|
group_names: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user