Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
e352a8ed
Unverified
Commit
e352a8ed
authored
Feb 27, 2024
by
Bowen Liang
Committed by
GitHub
Feb 27, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove redundant casting flask app config into dict (#2564)
parent
e55225e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
6 deletions
+5
-6
commands.py
api/commands.py
+1
-2
keyword_factory.py
api/core/rag/datasource/keyword/keyword_factory.py
+2
-2
vector_factory.py
api/core/rag/datasource/vdb/vector_factory.py
+2
-2
No files found.
api/commands.py
View file @
e352a8ed
import
base64
import
json
import
secrets
from
typing
import
cast
import
click
from
flask
import
current_app
...
...
@@ -132,7 +131,7 @@ def vdb_migrate():
"""
click
.
echo
(
click
.
style
(
'Start migrate vector db.'
,
fg
=
'green'
))
create_count
=
0
config
=
c
ast
(
dict
,
current_app
.
config
)
config
=
c
urrent_app
.
config
vector_type
=
config
.
get
(
'VECTOR_STORE'
)
page
=
1
while
True
:
...
...
api/core/rag/datasource/keyword/keyword_factory.py
View file @
e352a8ed
from
typing
import
Any
,
cast
from
typing
import
Any
from
flask
import
current_app
...
...
@@ -14,7 +14,7 @@ class Keyword:
self
.
_keyword_processor
=
self
.
_init_keyword
()
def
_init_keyword
(
self
)
->
BaseKeyword
:
config
=
c
ast
(
dict
,
current_app
.
config
)
config
=
c
urrent_app
.
config
keyword_type
=
config
.
get
(
'KEYWORD_STORE'
)
if
not
keyword_type
:
...
...
api/core/rag/datasource/vdb/vector_factory.py
View file @
e352a8ed
import
json
from
typing
import
Any
,
cast
from
typing
import
Any
from
flask
import
current_app
...
...
@@ -23,7 +23,7 @@ class Vector:
self
.
_vector_processor
=
self
.
_init_vector
()
def
_init_vector
(
self
)
->
BaseVector
:
config
=
c
ast
(
dict
,
current_app
.
config
)
config
=
c
urrent_app
.
config
vector_type
=
config
.
get
(
'VECTOR_STORE'
)
if
self
.
_dataset
.
index_struct_dict
:
...
...
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