Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
ef796498
Commit
ef796498
authored
1 year ago
by
timothycarambat
Browse files
Options
Downloads
Patches
Plain Diff
improve ms-sse-fetch to not re-fetch automatially
parent
79cdb863
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/src/models/workspace.js
+20
-0
20 additions, 0 deletions
frontend/src/models/workspace.js
with
20 additions
and
0 deletions
frontend/src/models/workspace.js
+
20
−
0
View file @
ef796498
...
@@ -66,6 +66,7 @@ const Workspace = {
...
@@ -66,6 +66,7 @@ const Workspace = {
body
:
JSON
.
stringify
({
message
,
mode
}),
body
:
JSON
.
stringify
({
message
,
mode
}),
headers
:
baseHeaders
(),
headers
:
baseHeaders
(),
signal
:
ctrl
.
signal
,
signal
:
ctrl
.
signal
,
openWhenHidden
:
true
,
async
onopen
(
response
)
{
async
onopen
(
response
)
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
return
;
// everything's good
return
;
// everything's good
...
@@ -74,8 +75,26 @@ const Workspace = {
...
@@ -74,8 +75,26 @@ const Workspace = {
response
.
status
<
500
&&
response
.
status
<
500
&&
response
.
status
!==
429
response
.
status
!==
429
)
{
)
{
handleChat
({
id
:
v4
(),
type
:
"
abort
"
,
textResponse
:
null
,
sources
:
[],
close
:
true
,
error
:
`An error occurred while streaming response. Code
${
response
.
status
}
`
,
});
ctrl
.
abort
();
throw
new
Error
(
"
Invalid Status code response.
"
);
throw
new
Error
(
"
Invalid Status code response.
"
);
}
else
{
}
else
{
handleChat
({
id
:
v4
(),
type
:
"
abort
"
,
textResponse
:
null
,
sources
:
[],
close
:
true
,
error
:
`An error occurred while streaming response. Unknown Error.`
,
});
ctrl
.
abort
();
throw
new
Error
(
"
Unknown error
"
);
throw
new
Error
(
"
Unknown error
"
);
}
}
},
},
...
@@ -95,6 +114,7 @@ const Workspace = {
...
@@ -95,6 +114,7 @@ const Workspace = {
error
:
`An error occurred while streaming response.
${
err
.
message
}
`
,
error
:
`An error occurred while streaming response.
${
err
.
message
}
`
,
});
});
ctrl
.
abort
();
ctrl
.
abort
();
throw
new
Error
();
},
},
});
});
},
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment