mirror of
https://github.com/LLM-Red-Team/glm-free-api.git
synced 2025-01-03 03:25:28 +08:00
修复代码生成调用输出
This commit is contained in:
parent
a969acd6fb
commit
05ecba5cc2
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "glm-free-api",
|
||||
"version": "0.0.32",
|
||||
"version": "0.0.33",
|
||||
"description": "GLM Free API Server",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
@ -991,7 +991,7 @@ async function receiveStream(stream: any): Promise<any> {
|
||||
textOffset += imageText.length;
|
||||
toolCall = true;
|
||||
return innerStr + imageText;
|
||||
} else if (type == "code" && partStatus == "init") {
|
||||
} else if (type == "code" && status == "init") {
|
||||
let codeHead = "";
|
||||
if (!codeGenerating) {
|
||||
codeGenerating = true;
|
||||
@ -1003,7 +1003,7 @@ async function receiveStream(stream: any): Promise<any> {
|
||||
return innerStr + codeHead + chunk;
|
||||
} else if (
|
||||
type == "code" &&
|
||||
partStatus == "finish" &&
|
||||
status == "finish" &&
|
||||
codeGenerating
|
||||
) {
|
||||
const codeFooter = "\n```\n";
|
||||
@ -1014,7 +1014,7 @@ async function receiveStream(stream: any): Promise<any> {
|
||||
} else if (
|
||||
type == "execution_output" &&
|
||||
_.isString(content) &&
|
||||
partStatus == "done" &&
|
||||
status == "finish" &&
|
||||
lastExecutionOutput != content
|
||||
) {
|
||||
lastExecutionOutput = content;
|
||||
@ -1154,7 +1154,7 @@ function createTransStream(stream: any, endCallback?: Function) {
|
||||
textOffset += imageText.length;
|
||||
toolCall = true;
|
||||
return innerStr + imageText;
|
||||
} else if (type == "code" && partStatus == "init") {
|
||||
} else if (type == "code" && status == "init") {
|
||||
let codeHead = "";
|
||||
if (!codeGenerating) {
|
||||
codeGenerating = true;
|
||||
@ -1166,7 +1166,7 @@ function createTransStream(stream: any, endCallback?: Function) {
|
||||
return innerStr + codeHead + chunk;
|
||||
} else if (
|
||||
type == "code" &&
|
||||
partStatus == "finish" &&
|
||||
status == "finish" &&
|
||||
codeGenerating
|
||||
) {
|
||||
const codeFooter = "\n```\n";
|
||||
@ -1177,7 +1177,7 @@ function createTransStream(stream: any, endCallback?: Function) {
|
||||
} else if (
|
||||
type == "execution_output" &&
|
||||
_.isString(content) &&
|
||||
partStatus == "done" &&
|
||||
status == "finish" &&
|
||||
lastExecutionOutput != content
|
||||
) {
|
||||
lastExecutionOutput = content;
|
||||
|
Loading…
Reference in New Issue
Block a user