doomiaichat 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/azureai.js CHANGED
@@ -148,8 +148,6 @@ class AzureAI extends openaibase_1.default {
148
148
  for (const choice of event.choices) {
149
149
  const { finishReason: finishreason, index } = choice;
150
150
  const content = (_d = choice.delta) === null || _d === void 0 ? void 0 : _d.content;
151
- if (!content)
152
- continue;
153
151
  replytext.push(content);
154
152
  let output = { successed: true, requestid, segment: content, text: replytext.join(''), finish_reason: finishreason, index }; //, usage };
155
153
  if (attach)
package/dist/openai.js CHANGED
@@ -135,8 +135,6 @@ class OpenAIGpt extends openaibase_1.default {
135
135
  try {
136
136
  const chunk = _c;
137
137
  const [choice] = chunk.choices, { content, finishreason, index, usage } = choice.delta;
138
- if (!content)
139
- continue;
140
138
  replytext.push(content);
141
139
  let output = { successed: true, requestid, segment: content, text: replytext.join(''), finish_reason: finishreason, index, usage };
142
140
  if (attach)
@@ -81,7 +81,7 @@ class OpenAIProxy extends openai_1.default {
81
81
  else {
82
82
  ///持续的文字输出中
83
83
  try {
84
- //streamText = JSON.parse(streamText);
84
+ streamText = JSON.parse(streamText);
85
85
  // overContent = JSON.parse(streamText);
86
86
  return this.emit('chattext', Object.assign(streamText, attach));
87
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doomiaichat",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Doomisoft OpenAI",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/azureai.ts CHANGED
@@ -130,7 +130,6 @@ export default class AzureAI extends OpenAIBase<OpenAIClient> {
130
130
  for (const choice of event.choices) {
131
131
  const { finishReason: finishreason, index } = choice;
132
132
  const content = choice.delta?.content;
133
- if (!content) continue;
134
133
  replytext.push(content);
135
134
  let output = { successed: true, requestid, segment: content, text: replytext.join(''), finish_reason: finishreason, index };//, usage };
136
135
  if (attach) output = Object.assign({}, output, attach);
package/src/openai.ts CHANGED
@@ -104,7 +104,6 @@ export default class OpenAIGpt extends OpenAIBase<OpenAI> {
104
104
  let replytext: string[] = [];
105
105
  for await (const chunk of response) {
106
106
  const [choice] = chunk.choices, { content, finishreason, index, usage } = choice.delta;
107
- if (!content) continue;
108
107
  replytext.push(content);
109
108
  let output = { successed: true, requestid, segment: content, text: replytext.join(''), finish_reason: finishreason, index, usage };
110
109
  if (attach) output = Object.assign({}, output, attach);
@@ -71,7 +71,7 @@ export default class OpenAIProxy extends OpenAIGpt {
71
71
  } else{
72
72
  ///持续的文字输出中
73
73
  try{
74
- //streamText = JSON.parse(streamText);
74
+ streamText = JSON.parse(streamText);
75
75
  // overContent = JSON.parse(streamText);
76
76
  return this.emit('chattext', Object.assign(streamText, attach));
77
77
  }catch(errParse){