Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
4b088e84
authored
Aug 25, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ts
parent
6d93059e
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
8 deletions
+30
-8
.github/workflows/fastgpt-image.yml
+25
-0
client/src/constants/kb.ts
+1
-3
client/src/pages/api/openapi/kb/updateData.ts
+1
-1
client/src/pages/api/plugins/kb/update.ts
+1
-1
client/src/pages/kb/detail/components/InputDataModal.tsx
+0
-1
client/src/service/utils/tools.ts
+2
-2
No files found.
.github/workflows/fastgpt-image.yml
View file @
4b088e84
...
@@ -77,3 +77,28 @@ jobs:
...
@@ -77,3 +77,28 @@ jobs:
run
:
docker tag ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}} ${{ secrets.DOCKER_IMAGE_NAME }}:${{env.IMAGE_TAG}}
run
:
docker tag ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}} ${{ secrets.DOCKER_IMAGE_NAME }}:${{env.IMAGE_TAG}}
-
name
:
Push image to Docker Hub
-
name
:
Push image to Docker Hub
run
:
docker push ${{ secrets.DOCKER_IMAGE_NAME }}:${{env.IMAGE_TAG}}
run
:
docker push ${{ secrets.DOCKER_IMAGE_NAME }}:${{env.IMAGE_TAG}}
push-to-ali-hub
:
needs
:
build-fastgpt-images
runs-on
:
ubuntu-20.04
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v3
-
name
:
Login to Ali Hub
uses
:
docker/login-action@v2
with
:
registry
:
registry.cn-hangzhou.aliyuncs.com
username
:
${{ secrets.ALI_HUB_USERNAME }}
password
:
${{ secrets.ALI_HUB_PASSWORD }}
-
name
:
Set DOCKER_REPO_TAGGED based on branch or tag
run
:
|
if [[ "${{ github.ref_name }}" == "main" ]]; then
echo "IMAGE_TAG=latest" >> $GITHUB_ENV
else
echo "IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
fi
-
name
:
Pull image from GitHub Container Registry
run
:
docker pull ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}}
-
name
:
Tag image with Docker Hub repository name and version tag
run
:
docker tag ghcr.io/${{ github.repository_owner }}/fastgpt:${{env.IMAGE_TAG}} ${{ secrets.ALI_IMAGE_NAME }}:${{env.IMAGE_TAG}}
-
name
:
Push image to Docker Hub
run
:
docker push ${{ secrets.ALI_IMAGE_NAME }}:${{env.IMAGE_TAG}}
client/src/constants/kb.ts
View file @
4b088e84
...
@@ -3,10 +3,8 @@ import type { KbItemType } from '@/types/plugin';
...
@@ -3,10 +3,8 @@ import type { KbItemType } from '@/types/plugin';
export
const
defaultKbDetail
:
KbItemType
=
{
export
const
defaultKbDetail
:
KbItemType
=
{
_id
:
''
,
_id
:
''
,
userId
:
''
,
userId
:
''
,
updateTime
:
new
Date
(),
avatar
:
'/icon/logo.svg'
,
avatar
:
'/icon/logo.svg'
,
name
:
''
,
name
:
''
,
tags
:
''
,
tags
:
''
,
totalData
:
0
,
vectorModelName
:
'text-embedding-ada-002'
model
:
'text-embedding-ada-002'
};
};
client/src/pages/api/openapi/kb/updateData.ts
View file @
4b088e84
...
@@ -40,7 +40,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
...
@@ -40,7 +40,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
return
getVector
({
return
getVector
({
userId
,
userId
,
input
:
[
q
],
input
:
[
q
],
model
:
kb
.
m
odel
model
:
kb
.
vectorM
odel
});
});
}
}
return
{
vectors
:
[[]]
};
return
{
vectors
:
[[]]
};
...
...
client/src/pages/api/plugins/kb/update.ts
View file @
4b088e84
...
@@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
...
@@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from 'next';
import
{
jsonRes
}
from
'@/service/response'
;
import
{
jsonRes
}
from
'@/service/response'
;
import
{
connectToDatabase
,
KB
}
from
'@/service/mongo'
;
import
{
connectToDatabase
,
KB
}
from
'@/service/mongo'
;
import
{
authUser
}
from
'@/service/utils/auth'
;
import
{
authUser
}
from
'@/service/utils/auth'
;
import
type
{
KbUpdateParams
}
from
'@/api/
plugins
/kb'
;
import
type
{
KbUpdateParams
}
from
'@/api/
request
/kb'
;
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
<
any
>
)
{
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
<
any
>
)
{
try
{
try
{
...
...
client/src/pages/kb/detail/components/InputDataModal.tsx
View file @
4b088e84
...
@@ -56,7 +56,6 @@ const InputDataModal = ({
...
@@ -56,7 +56,6 @@ const InputDataModal = ({
};
};
const
{
insertLen
}
=
await
postKbDataFromList
({
const
{
insertLen
}
=
await
postKbDataFromList
({
kbId
,
kbId
,
model
:
vectorModelList
[
0
].
model
,
mode
:
TrainingModeEnum
.
index
,
mode
:
TrainingModeEnum
.
index
,
data
:
[
data
]
data
:
[
data
]
});
});
...
...
client/src/service/utils/tools.ts
View file @
4b088e84
...
@@ -92,9 +92,9 @@ export const sseResponse = ({
...
@@ -92,9 +92,9 @@ export const sseResponse = ({
/* add logger */
/* add logger */
export
const
addLog
=
{
export
const
addLog
=
{
info
:
(
msg
:
string
,
obj
?:
Record
<
string
,
any
>
)
=>
{
info
:
(
msg
:
string
,
obj
?:
Record
<
string
,
any
>
)
=>
{
global
.
logger
.
info
(
msg
,
{
meta
:
obj
});
global
.
logger
?
.
info
(
msg
,
{
meta
:
obj
});
},
},
error
:
(
msg
:
string
,
obj
?:
Record
<
string
,
any
>
)
=>
{
error
:
(
msg
:
string
,
obj
?:
Record
<
string
,
any
>
)
=>
{
global
.
logger
.
error
(
msg
,
{
meta
:
obj
});
global
.
logger
?
.
error
(
msg
,
{
meta
:
obj
});
}
}
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment