Compare commits

...

4 Commits

Author SHA1 Message Date
RiverRay
c6199dbf9f Merge pull request #6186 from siliconflow/fix-truc-of-reasoning-model
Some checks are pending
Run Tests / test (push) Waiting to run
Fix formatting of reasoning model on SiliconFlow
2025-02-08 23:40:39 +08:00
RiverRay
4273aa0803 Merge pull request #6185 from siliconflow/larger_timeout_for_siliconflow
Larger timeout for SiliconFlow
2025-02-08 23:39:49 +08:00
Shenghang Tsai
acf75ce68f Remove unnecessary trimming 2025-02-08 16:34:17 +08:00
Shenghang Tsai
2a3996e0d6 Update siliconflow.ts 2025-02-08 14:38:12 +08:00
2 changed files with 9 additions and 9 deletions

View File

@@ -121,10 +121,10 @@ export class SiliconflowApi implements LLMApi {
// console.log(chatPayload);
// make a fetch request
const requestTimeoutId = setTimeout(
() => controller.abort(),
REQUEST_TIMEOUT_MS,
);
const requestTimeoutId = setTimeout(() => {
console.error("[Request] SiliconFlow API timeout");
controller.abort();
}, 10 * REQUEST_TIMEOUT_MS);
if (shouldStream) {
const [tools, funcs] = usePluginStore
@@ -174,8 +174,8 @@ export class SiliconflowApi implements LLMApi {
// Skip if both content and reasoning_content are empty or null
if (
(!reasoning || reasoning.trim().length === 0) &&
(!content || content.trim().length === 0)
(!reasoning || reasoning.length === 0) &&
(!content || content.length === 0)
) {
return {
isThinking: false,
@@ -183,12 +183,12 @@ export class SiliconflowApi implements LLMApi {
};
}
if (reasoning && reasoning.trim().length > 0) {
if (reasoning && reasoning.length > 0) {
return {
isThinking: true,
content: reasoning,
};
} else if (content && content.trim().length > 0) {
} else if (content && content.length > 0) {
return {
isThinking: false,
content: content,

View File

@@ -576,7 +576,7 @@ export function streamWithThink(
try {
const chunk = parseSSE(text, runTools);
// Skip if content is empty
if (!chunk?.content || chunk.content.trim().length === 0) {
if (!chunk?.content || chunk.content.length === 0) {
return;
}
// Check if thinking mode changed