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
a92b028a
Commit
a92b028a
authored
Jun 21, 2023
by
John Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: remove notion load_as_text func
parent
bb22e823
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
data_source.py
api/controllers/console/datasets/data_source.py
+2
-1
notion.py
api/core/data_loader/loader/notion.py
+0
-5
No files found.
api/controllers/console/datasets/data_source.py
View file @
a92b028a
...
...
@@ -239,8 +239,9 @@ class DataSourceNotionApi(Resource):
notion_page_type
=
page_type
)
text_docs
=
loader
.
load
()
return
{
'content'
:
loader
.
load_as_text
(
)
'content'
:
"
\n
"
.
join
([
doc
.
page_content
for
doc
in
text_docs
]
)
},
200
@
setup_required
...
...
api/core/data_loader/loader/notion.py
View file @
a92b028a
...
...
@@ -75,11 +75,6 @@ class NotionLoader(BaseLoader):
return
text_docs
def
load_as_text
(
self
)
->
str
:
text_docs
=
self
.
_load_data_as_documents
(
self
.
_notion_obj_id
,
self
.
_notion_page_type
)
text
=
"
\n
"
.
join
([
doc
.
page_content
for
doc
in
text_docs
])
return
text
def
_load_data_as_documents
(
self
,
notion_obj_id
:
str
,
notion_page_type
:
str
)
->
List
[
Document
]:
...
...
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