fix: stream response (#3682)
* perf: supplement assistant empty response * check array * fix: stream response * fix: model config cannot set to null
This commit is contained in:
@@ -45,14 +45,14 @@
|
|||||||
"type": "llm"
|
"type": "llm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "o1-mini",
|
"model": "o3-mini",
|
||||||
"name": "o1-mini",
|
"name": "o3-mini",
|
||||||
"maxContext": 128000,
|
"maxContext": 200000,
|
||||||
"maxResponse": 4000,
|
"maxResponse": 100000,
|
||||||
"quoteMaxToken": 120000,
|
"quoteMaxToken": 120000,
|
||||||
"maxTemperature": null,
|
"maxTemperature": null,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": false,
|
"toolChoice": true,
|
||||||
"functionCall": false,
|
"functionCall": false,
|
||||||
"defaultSystemChatPrompt": "",
|
"defaultSystemChatPrompt": "",
|
||||||
"datasetProcess": true,
|
"datasetProcess": true,
|
||||||
@@ -71,8 +71,8 @@
|
|||||||
"type": "llm"
|
"type": "llm"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"model": "o1-preview",
|
"model": "o1-mini",
|
||||||
"name": "o1-preview",
|
"name": "o1-mini",
|
||||||
"maxContext": 128000,
|
"maxContext": 128000,
|
||||||
"maxResponse": 4000,
|
"maxResponse": 4000,
|
||||||
"quoteMaxToken": 120000,
|
"quoteMaxToken": 120000,
|
||||||
@@ -103,6 +103,32 @@
|
|||||||
"maxResponse": 8000,
|
"maxResponse": 8000,
|
||||||
"quoteMaxToken": 120000,
|
"quoteMaxToken": 120000,
|
||||||
"maxTemperature": null,
|
"maxTemperature": null,
|
||||||
|
"vision": true,
|
||||||
|
"toolChoice": false,
|
||||||
|
"functionCall": false,
|
||||||
|
"defaultSystemChatPrompt": "",
|
||||||
|
"datasetProcess": true,
|
||||||
|
"usedInClassify": true,
|
||||||
|
"customCQPrompt": "",
|
||||||
|
"usedInExtractFields": true,
|
||||||
|
"usedInQueryExtension": true,
|
||||||
|
"customExtractPrompt": "",
|
||||||
|
"usedInToolCall": true,
|
||||||
|
"defaultConfig": {
|
||||||
|
"stream": false
|
||||||
|
},
|
||||||
|
"fieldMap": {
|
||||||
|
"max_tokens": "max_completion_tokens"
|
||||||
|
},
|
||||||
|
"type": "llm"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"model": "o1-preview",
|
||||||
|
"name": "o1-preview",
|
||||||
|
"maxContext": 128000,
|
||||||
|
"maxResponse": 4000,
|
||||||
|
"quoteMaxToken": 120000,
|
||||||
|
"maxTemperature": null,
|
||||||
"vision": false,
|
"vision": false,
|
||||||
"toolChoice": false,
|
"toolChoice": false,
|
||||||
"functionCall": false,
|
"functionCall": false,
|
||||||
|
|||||||
@@ -208,7 +208,6 @@ export const dispatchChatCompletion = async (props: ChatProps): Promise<ChatResp
|
|||||||
: '';
|
: '';
|
||||||
if (stream) {
|
if (stream) {
|
||||||
// Some models do not support streaming
|
// Some models do not support streaming
|
||||||
reasoning &&
|
|
||||||
workflowStreamResponse?.({
|
workflowStreamResponse?.({
|
||||||
event: SseResponseEventEnum.fastAnswer,
|
event: SseResponseEventEnum.fastAnswer,
|
||||||
data: textAdaptGptResponse({
|
data: textAdaptGptResponse({
|
||||||
|
|||||||
@@ -804,7 +804,7 @@ const ModelEditModal = ({
|
|||||||
value={JSON.stringify(getValues('defaultConfig'), null, 2)}
|
value={JSON.stringify(getValues('defaultConfig'), null, 2)}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
setValue('defaultConfig', undefined);
|
setValue('defaultConfig', {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -1014,7 +1014,7 @@ const ModelEditModal = ({
|
|||||||
resize
|
resize
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
if (!e) {
|
if (!e) {
|
||||||
setValue('defaultConfig', undefined);
|
setValue('defaultConfig', {});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user