Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAGchat-API
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
zbhAI
RAGchat-API
Commits
9c852fae
Commit
9c852fae
authored
10 months ago
by
Embruch, Gerd
Browse files
Options
Downloads
Patches
Plain Diff
fixed output
parent
6fcb8e62
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/auth/confirmpasswordreset.test.js
+2
-2
2 additions, 2 deletions
__tests__/auth/confirmpasswordreset.test.js
utils/handleAI.js
+6
-1
6 additions, 1 deletion
utils/handleAI.js
with
8 additions
and
3 deletions
__tests__/auth/confirmpasswordreset.test.js
+
2
−
2
View file @
9c852fae
...
...
@@ -98,7 +98,7 @@ describe('user confirm password reset', () => {
.
send
(
input
);
});
it
(
'
should return a proper status code
'
,
()
=>
{
expect
(
response
.
status
).
toBe
(
4
03
);
expect
(
response
.
status
).
toBe
(
4
98
);
});
it
(
'
should respond with a proper body
'
,
()
=>
{
expect
(
response
.
body
).
toMatchSnapshot
();
...
...
@@ -117,7 +117,7 @@ describe('user confirm password reset', () => {
.
send
(
input
);
});
it
(
'
should return a proper status code
'
,
()
=>
{
expect
(
response
.
status
).
toBe
(
4
03
);
expect
(
response
.
status
).
toBe
(
4
98
);
});
it
(
'
should respond with a proper body
'
,
()
=>
{
expect
(
response
.
body
).
toMatchSnapshot
();
...
...
This diff is collapsed.
Click to expand it.
utils/handleAI.js
+
6
−
1
View file @
9c852fae
...
...
@@ -65,7 +65,8 @@ export const aiInstallModel = async (model) => {
*/
export
const
aiDeleteModel
=
async
(
model
)
=>
{
try
{
return
await
ollama
.
delete
({
model
});
const
message
=
await
ollama
.
delete
({
model
});
return
{
message
:
`model
${
model
}
deleted`
};
}
catch
(
error
)
{
throw
error
;
}
...
...
@@ -186,6 +187,8 @@ export const chat = async (req, res, next) => {
const
reliesOnDoc
=
await
isFactual
(
req
.
body
.
model
,
result
.
answer
,
result
.
context
[
0
].
pageContent
);
let
sourceLocation
;
console
.
log
(
"
🚀 ~ chat ~ reliesOnDoc.content.toLowerCase():
"
,
reliesOnDoc
.
content
.
toLowerCase
());
if
(
reliesOnDoc
.
content
.
toLowerCase
()
===
'
true
'
)
{
const
file
=
path
.
posix
.
basename
(
result
.
context
[
0
].
metadata
.
source
);
const
posFrom
=
result
.
context
[
0
].
metadata
.
loc
.
lines
.
from
;
...
...
@@ -208,6 +211,8 @@ export const chat = async (req, res, next) => {
/** *******************************************************
* CREATE AI SUMMARIZED TEXT
*/
...
...
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