mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 09:05:55 +08:00
Update comments (#4569)
### What problem does this PR solve? Add license statement. ### Type of change - [x] Refactoring Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
parent
583050a876
commit
3894de895b
@ -1,2 +1,18 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from beartype.claw import beartype_this_package
|
from beartype.claw import beartype_this_package
|
||||||
beartype_this_package()
|
beartype_this_package()
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
from .begin import Begin, BeginParam
|
from .begin import Begin, BeginParam
|
||||||
from .generate import Generate, GenerateParam
|
from .generate import Generate, GenerateParam
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2019 The FATE Authors. All Rights Reserved.
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -1,2 +1,18 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from beartype.claw import beartype_this_package
|
from beartype.claw import beartype_this_package
|
||||||
beartype_this_package()
|
beartype_this_package()
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
@ -1,2 +1,18 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from beartype.claw import beartype_this_package
|
from beartype.claw import beartype_this_package
|
||||||
beartype_this_package()
|
beartype_this_package()
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -11,6 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
from rag.nlp import find_codec
|
from rag.nlp import find_codec
|
||||||
import readability
|
import readability
|
||||||
import html_text
|
import html_text
|
||||||
|
@ -1,4 +1,20 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
# The following documents are mainly referenced, and only adaptation modifications have been made
|
# The following documents are mainly referenced, and only adaptation modifications have been made
|
||||||
# from https://github.com/langchain-ai/langchain/blob/master/libs/text-splitters/langchain_text_splitters/json.py
|
# from https://github.com/langchain-ai/langchain/blob/master/libs/text-splitters/langchain_text_splitters/json.py
|
||||||
|
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -11,6 +14,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class RAGFlowMarkdownParser:
|
class RAGFlowMarkdownParser:
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from pptx import Presentation
|
from pptx import Presentation
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
TBL = {
|
TBL = {
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from deepdoc.parser.utils import get_text
|
from deepdoc.parser.utils import get_text
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from beartype.claw import beartype_this_package
|
from beartype.claw import beartype_this_package
|
||||||
beartype_this_package()
|
beartype_this_package()
|
||||||
|
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import requests
|
import requests
|
||||||
from bridge.context import ContextType # Import Context, ContextType
|
from bridge.context import ContextType # Import Context, ContextType
|
||||||
|
@ -1,2 +1,18 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from beartype.claw import beartype_this_package
|
from beartype.claw import beartype_this_package
|
||||||
beartype_this_package()
|
beartype_this_package()
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from api.db import LLMType
|
from api.db import LLMType
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from tika import parser
|
from tika import parser
|
||||||
import re
|
import re
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from graphrag.index import build_knowledge_graph_chunks
|
from graphrag.index import build_knowledge_graph_chunks
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from tika import parser
|
from tika import parser
|
||||||
import re
|
import re
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# Copyright 2024 The InfiniFlow Authors. All Rights Reserved.
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from tika import parser
|
from tika import parser
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from tika import parser
|
from tika import parser
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import csv
|
import csv
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import base64
|
import base64
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import re
|
import re
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -10,6 +13,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import csv
|
import csv
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from jina import Deployment
|
from jina import Deployment
|
||||||
from docarray import BaseDoc
|
from docarray import BaseDoc
|
||||||
from jina import Executor, requests
|
from jina import Executor, requests
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from minio import Minio
|
from minio import Minio
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import boto3
|
import boto3
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import ragflow_sdk
|
import ragflow_sdk
|
||||||
|
|
||||||
print(ragflow_sdk.__version__)
|
print(ragflow_sdk.__version__)
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from beartype.claw import beartype_this_package
|
from beartype.claw import beartype_this_package
|
||||||
beartype_this_package()
|
beartype_this_package()
|
||||||
|
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from .base import Base
|
from .base import Base
|
||||||
from .session import Session
|
from .session import Session
|
||||||
import requests
|
import requests
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
class Base(object):
|
class Base(object):
|
||||||
def __init__(self, rag, res_dict):
|
def __init__(self, rag, res_dict):
|
||||||
self.rag = rag
|
self.rag = rag
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
from .base import Base
|
from .base import Base
|
||||||
from .session import Session
|
from .session import Session
|
||||||
@ -49,7 +65,6 @@ class Chat(Base):
|
|||||||
if res.get("code") != 0:
|
if res.get("code") != 0:
|
||||||
raise Exception(res["message"])
|
raise Exception(res["message"])
|
||||||
|
|
||||||
|
|
||||||
def create_session(self, name: str = "New session") -> Session:
|
def create_session(self, name: str = "New session") -> Session:
|
||||||
res = self.post(f"/chats/{self.id}/sessions", {"name": name})
|
res = self.post(f"/chats/{self.id}/sessions", {"name": name})
|
||||||
res = res.json()
|
res = res.json()
|
||||||
@ -59,7 +74,8 @@ class Chat(Base):
|
|||||||
|
|
||||||
def list_sessions(self, page: int = 1, page_size: int = 30, orderby: str = "create_time", desc: bool = True,
|
def list_sessions(self, page: int = 1, page_size: int = 30, orderby: str = "create_time", desc: bool = True,
|
||||||
id: str = None, name: str = None) -> list[Session]:
|
id: str = None, name: str = None) -> list[Session]:
|
||||||
res = self.get(f'/chats/{self.id}/sessions',{"page": page, "page_size": page_size, "orderby": orderby, "desc": desc, "id": id, "name": name} )
|
res = self.get(f'/chats/{self.id}/sessions',
|
||||||
|
{"page": page, "page_size": page_size, "orderby": orderby, "desc": desc, "id": id, "name": name})
|
||||||
res = res.json()
|
res = res.json()
|
||||||
if res.get("code") == 0:
|
if res.get("code") == 0:
|
||||||
result_list = []
|
result_list = []
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from .base import Base
|
from .base import Base
|
||||||
|
|
||||||
|
|
||||||
@ -18,11 +34,8 @@ class Chunk(Base):
|
|||||||
res_dict.pop(k)
|
res_dict.pop(k)
|
||||||
super().__init__(rag, res_dict)
|
super().__init__(rag, res_dict)
|
||||||
|
|
||||||
|
|
||||||
def update(self, update_message: dict):
|
def update(self, update_message: dict):
|
||||||
res = self.put(f"/datasets/{self.dataset_id}/documents/{self.document_id}/chunks/{self.id}", update_message)
|
res = self.put(f"/datasets/{self.dataset_id}/documents/{self.document_id}/chunks/{self.id}", update_message)
|
||||||
res = res.json()
|
res = res.json()
|
||||||
if res.get("code") != 0:
|
if res.get("code") != 0:
|
||||||
raise Exception(res["message"])
|
raise Exception(res["message"])
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from .document import Document
|
from .document import Document
|
||||||
|
|
||||||
from .base import Base
|
from .base import Base
|
||||||
@ -47,8 +63,11 @@ class DataSet(Base):
|
|||||||
return doc_list
|
return doc_list
|
||||||
raise Exception(res.get("message"))
|
raise Exception(res.get("message"))
|
||||||
|
|
||||||
def list_documents(self, id: str | None = None, keywords: str | None = None, page: int = 1, page_size: int = 30, orderby: str = "create_time", desc: bool = True):
|
def list_documents(self, id: str | None = None, keywords: str | None = None, page: int = 1, page_size: int = 30,
|
||||||
res = self.get(f"/datasets/{self.id}/documents",params={"id": id,"keywords": keywords,"page": page,"page_size": page_size,"orderby": orderby,"desc": desc})
|
orderby: str = "create_time", desc: bool = True):
|
||||||
|
res = self.get(f"/datasets/{self.id}/documents",
|
||||||
|
params={"id": id, "keywords": keywords, "page": page, "page_size": page_size, "orderby": orderby,
|
||||||
|
"desc": desc})
|
||||||
res = res.json()
|
res = res.json()
|
||||||
documents = []
|
documents = []
|
||||||
if res.get("code") == 0:
|
if res.get("code") == 0:
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import json
|
import json
|
||||||
from .base import Base
|
from .base import Base
|
||||||
from .chunk import Chunk
|
from .chunk import Chunk
|
||||||
@ -32,7 +48,6 @@ class Document(Base):
|
|||||||
res_dict.pop(k)
|
res_dict.pop(k)
|
||||||
super().__init__(rag, res_dict)
|
super().__init__(rag, res_dict)
|
||||||
|
|
||||||
|
|
||||||
def update(self, update_message: dict):
|
def update(self, update_message: dict):
|
||||||
res = self.put(f'/datasets/{self.dataset_id}/documents/{self.id}',
|
res = self.put(f'/datasets/{self.dataset_id}/documents/{self.id}',
|
||||||
update_message)
|
update_message)
|
||||||
@ -48,7 +63,6 @@ class Document(Base):
|
|||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
return res.content
|
return res.content
|
||||||
|
|
||||||
|
|
||||||
def list_chunks(self, page=1, page_size=30, keywords=""):
|
def list_chunks(self, page=1, page_size=30, keywords=""):
|
||||||
data = {"keywords": keywords, "page": page, "page_size": page_size}
|
data = {"keywords": keywords, "page": page, "page_size": page_size}
|
||||||
res = self.get(f'/datasets/{self.dataset_id}/documents/{self.id}/chunks', data)
|
res = self.get(f'/datasets/{self.dataset_id}/documents/{self.id}/chunks', data)
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from .base import Base
|
from .base import Base
|
||||||
@ -63,6 +79,7 @@ class Session(Base):
|
|||||||
if res.get("code") != 0:
|
if res.get("code") != 0:
|
||||||
raise Exception(res.get("message"))
|
raise Exception(res.get("message"))
|
||||||
|
|
||||||
|
|
||||||
class Message(Base):
|
class Message(Base):
|
||||||
def __init__(self, rag, res_dict):
|
def __init__(self, rag, res_dict):
|
||||||
self.content = "Hi! I am your assistant,can I help you?"
|
self.content = "Hi! I am your assistant,can I help you?"
|
||||||
|
@ -1,22 +1,40 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
HOST_ADDRESS = os.getenv('HOST_ADDRESS', 'http://127.0.0.1:9380')
|
HOST_ADDRESS = os.getenv('HOST_ADDRESS', 'http://127.0.0.1:9380')
|
||||||
|
|
||||||
|
|
||||||
# def generate_random_email():
|
# def generate_random_email():
|
||||||
# return 'user_' + ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))+'@1.com'
|
# return 'user_' + ''.join(random.choices(string.ascii_lowercase + string.digits, k=8))+'@1.com'
|
||||||
|
|
||||||
def generate_email():
|
def generate_email():
|
||||||
return 'user_123@1.com'
|
return 'user_123@1.com'
|
||||||
|
|
||||||
|
|
||||||
EMAIL = generate_email()
|
EMAIL = generate_email()
|
||||||
# password is "123"
|
# password is "123"
|
||||||
PASSWORD = '''ctAseGvejiaSWWZ88T/m4FQVOpQyUvP+x7sXtdv3feqZACiQleuewkUi35E16wSd5C5QcnkkcV9cYc8TKPTRZlxappDuirxghxoOvFcJxFU4ixLsD
|
PASSWORD = '''ctAseGvejiaSWWZ88T/m4FQVOpQyUvP+x7sXtdv3feqZACiQleuewkUi35E16wSd5C5QcnkkcV9cYc8TKPTRZlxappDuirxghxoOvFcJxFU4ixLsD
|
||||||
fN33jCHRoDUW81IH9zjij/vaw8IbVyb6vuwg6MX6inOEBRRzVbRYxXOu1wkWY6SsI8X70oF9aeLFp/PzQpjoe/YbSqpTq8qqrmHzn9vO+yvyYyvmDsphXe
|
fN33jCHRoDUW81IH9zjij/vaw8IbVyb6vuwg6MX6inOEBRRzVbRYxXOu1wkWY6SsI8X70oF9aeLFp/PzQpjoe/YbSqpTq8qqrmHzn9vO+yvyYyvmDsphXe
|
||||||
X8f7fp9c7vUsfOCkM+gHY3PadG+QHa7KI7mzTKgUTZImK6BZtfRBATDTthEUbbaTewY4H0MnWiCeeDhcbeQao6cFy1To8pE3RpmxnGnS8BsBn8w=='''
|
X8f7fp9c7vUsfOCkM+gHY3PadG+QHa7KI7mzTKgUTZImK6BZtfRBATDTthEUbbaTewY4H0MnWiCeeDhcbeQao6cFy1To8pE3RpmxnGnS8BsBn8w=='''
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
url = HOST_ADDRESS + "/v1/user/register"
|
url = HOST_ADDRESS + "/v1/user/register"
|
||||||
name = "user"
|
name = "user"
|
||||||
@ -26,6 +44,7 @@ def register():
|
|||||||
if res.get("code") != 0:
|
if res.get("code") != 0:
|
||||||
raise Exception(res.get("message"))
|
raise Exception(res.get("message"))
|
||||||
|
|
||||||
|
|
||||||
def login():
|
def login():
|
||||||
url = HOST_ADDRESS + "/v1/user/login"
|
url = HOST_ADDRESS + "/v1/user/login"
|
||||||
login_data = {"email": EMAIL, "password": PASSWORD}
|
login_data = {"email": EMAIL, "password": PASSWORD}
|
||||||
@ -36,6 +55,7 @@ def login():
|
|||||||
auth = response.headers["Authorization"]
|
auth = response.headers["Authorization"]
|
||||||
return auth
|
return auth
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def get_api_key_fixture():
|
def get_api_key_fixture():
|
||||||
try:
|
try:
|
||||||
@ -51,6 +71,7 @@ def get_api_key_fixture():
|
|||||||
raise Exception(res.get("message"))
|
raise Exception(res.get("message"))
|
||||||
return res["data"].get("token")
|
return res["data"].get("token")
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def get_auth():
|
def get_auth():
|
||||||
try:
|
try:
|
||||||
@ -60,6 +81,7 @@ def get_auth():
|
|||||||
auth = login()
|
auth = login()
|
||||||
return auth
|
return auth
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def get_email():
|
def get_email():
|
||||||
return EMAIL
|
return EMAIL
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
def test_get_email(get_email):
|
def test_get_email(get_email):
|
||||||
print("\nEmail account:",flush=True)
|
print("\nEmail account:",flush=True)
|
||||||
print(f"{get_email}\n",flush=True)
|
print(f"{get_email}\n",flush=True)
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from common import create_dataset, list_dataset, rm_dataset, update_dataset, DATASET_NAME_LIMIT
|
from common import create_dataset, list_dataset, rm_dataset, update_dataset, DATASET_NAME_LIMIT
|
||||||
import re
|
import re
|
||||||
import random
|
import random
|
||||||
@ -121,7 +137,8 @@ def test_update_different_params_dataset_success(get_auth):
|
|||||||
print(f"found {len(dataset_list)} datasets")
|
print(f"found {len(dataset_list)} datasets")
|
||||||
dataset_id = dataset_list[0]
|
dataset_id = dataset_list[0]
|
||||||
|
|
||||||
json_req = {"kb_id": dataset_id, "name": "test_update_dataset", "description": "test", "permission": "me", "parser_id": "presentation",
|
json_req = {"kb_id": dataset_id, "name": "test_update_dataset", "description": "test", "permission": "me",
|
||||||
|
"parser_id": "presentation",
|
||||||
"language": "spanish"}
|
"language": "spanish"}
|
||||||
res = update_dataset(get_auth, json_req)
|
res = update_dataset(get_auth, json_req)
|
||||||
assert res.get("code") == 0, f"{res.get('message')}"
|
assert res.get("code") == 0, f"{res.get('message')}"
|
||||||
@ -164,4 +181,3 @@ def test_update_different_params_dataset_fail(get_auth):
|
|||||||
res = rm_dataset(get_auth, dataset_id)
|
res = rm_dataset(get_auth, dataset_id)
|
||||||
assert res.get("code") == 0, f"{res.get('message')}"
|
assert res.get("code") == 0, f"{res.get('message')}"
|
||||||
print(f"{len(dataset_list)} datasets are deleted")
|
print(f"{len(dataset_list)} datasets are deleted")
|
||||||
|
|
||||||
|
@ -1,2 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
HOST_ADDRESS = os.getenv('HOST_ADDRESS', 'http://127.0.0.1:9380')
|
HOST_ADDRESS = os.getenv('HOST_ADDRESS', 'http://127.0.0.1:9380')
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
def test_get_email(get_email):
|
def test_get_email(get_email):
|
||||||
print("\nEmail account:", flush=True)
|
print("\nEmail account:", flush=True)
|
||||||
print(f"{get_email}\n", flush=True)
|
print(f"{get_email}\n", flush=True)
|
@ -1,7 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from ragflow_sdk import RAGFlow, Agent
|
from ragflow_sdk import RAGFlow, Agent
|
||||||
from common import HOST_ADDRESS
|
from common import HOST_ADDRESS
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="")
|
@pytest.mark.skip(reason="")
|
||||||
def test_list_agents_with_success(get_api_key_fixture):
|
def test_list_agents_with_success(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
|
@ -1,6 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from ragflow_sdk import RAGFlow
|
from ragflow_sdk import RAGFlow
|
||||||
from common import HOST_ADDRESS
|
from common import HOST_ADDRESS
|
||||||
|
|
||||||
|
|
||||||
def test_create_chat_with_name(get_api_key_fixture):
|
def test_create_chat_with_name(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -50,6 +67,7 @@ def test_delete_chats_with_success(get_api_key_fixture):
|
|||||||
chat = rag.create_chat("test_delete_chat", dataset_ids=[kb.id])
|
chat = rag.create_chat("test_delete_chat", dataset_ids=[kb.id])
|
||||||
rag.delete_chats(ids=[chat.id])
|
rag.delete_chats(ids=[chat.id])
|
||||||
|
|
||||||
|
|
||||||
def test_list_chats_with_success(get_api_key_fixture):
|
def test_list_chats_with_success(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -66,5 +84,3 @@ def test_list_chats_with_success(get_api_key_fixture):
|
|||||||
rag.create_chat("test_list_1", dataset_ids=[kb.id])
|
rag.create_chat("test_list_1", dataset_ids=[kb.id])
|
||||||
rag.create_chat("test_list_2", dataset_ids=[kb.id])
|
rag.create_chat("test_list_2", dataset_ids=[kb.id])
|
||||||
rag.list_chats()
|
rag.list_chats()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from ragflow_sdk import RAGFlow
|
from ragflow_sdk import RAGFlow
|
||||||
from common import HOST_ADDRESS
|
from common import HOST_ADDRESS
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
|
||||||
def test_parse_document_with_txt(get_api_key_fixture):
|
def test_parse_document_with_txt(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -21,6 +38,7 @@ def test_parse_document_with_txt(get_api_key_fixture):
|
|||||||
raise Exception("Run time ERROR: Document parsing did not complete in time.")
|
raise Exception("Run time ERROR: Document parsing did not complete in time.")
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
def test_parse_and_cancel_document(get_api_key_fixture):
|
def test_parse_and_cancel_document(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -60,6 +78,7 @@ def test_bulk_parse_documents(get_api_key_fixture):
|
|||||||
raise Exception("Run time ERROR: Bulk document parsing did not complete in time.")
|
raise Exception("Run time ERROR: Bulk document parsing did not complete in time.")
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
def test_list_chunks_with_success(get_api_key_fixture):
|
def test_list_chunks_with_success(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -151,6 +170,7 @@ def test_update_chunk_content(get_api_key_fixture):
|
|||||||
sleep(3)
|
sleep(3)
|
||||||
chunk.update({"content": "This is a updated content"})
|
chunk.update({"content": "This is a updated content"})
|
||||||
|
|
||||||
|
|
||||||
def test_update_chunk_available(get_api_key_fixture):
|
def test_update_chunk_available(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
|
@ -1,13 +1,31 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from ragflow_sdk import RAGFlow
|
from ragflow_sdk import RAGFlow
|
||||||
import random
|
import random
|
||||||
import pytest
|
import pytest
|
||||||
from common import HOST_ADDRESS
|
from common import HOST_ADDRESS
|
||||||
|
|
||||||
|
|
||||||
def test_create_dataset_with_name(get_api_key_fixture):
|
def test_create_dataset_with_name(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
rag.create_dataset("test_create_dataset_with_name")
|
rag.create_dataset("test_create_dataset_with_name")
|
||||||
|
|
||||||
|
|
||||||
def test_create_dataset_with_duplicated_name(get_api_key_fixture):
|
def test_create_dataset_with_duplicated_name(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -16,13 +34,16 @@ def test_create_dataset_with_duplicated_name(get_api_key_fixture):
|
|||||||
rag.create_dataset("test_create_dataset_with_duplicated_name")
|
rag.create_dataset("test_create_dataset_with_duplicated_name")
|
||||||
assert str(exc_info.value) == "Duplicated dataset name in creating dataset."
|
assert str(exc_info.value) == "Duplicated dataset name in creating dataset."
|
||||||
|
|
||||||
|
|
||||||
def test_create_dataset_with_random_chunk_method(get_api_key_fixture):
|
def test_create_dataset_with_random_chunk_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
valid_chunk_methods = ["naive","manual","qa","table","paper","book","laws","presentation","picture","one","knowledge_graph","email"]
|
valid_chunk_methods = ["naive", "manual", "qa", "table", "paper", "book", "laws", "presentation", "picture", "one",
|
||||||
|
"knowledge_graph", "email"]
|
||||||
random_chunk_method = random.choice(valid_chunk_methods)
|
random_chunk_method = random.choice(valid_chunk_methods)
|
||||||
rag.create_dataset("test_create_dataset_with_random_chunk_method", chunk_method=random_chunk_method)
|
rag.create_dataset("test_create_dataset_with_random_chunk_method", chunk_method=random_chunk_method)
|
||||||
|
|
||||||
|
|
||||||
def test_create_dataset_with_invalid_parameter(get_api_key_fixture):
|
def test_create_dataset_with_invalid_parameter(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
|
@ -1,7 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from ragflow_sdk import RAGFlow
|
from ragflow_sdk import RAGFlow
|
||||||
from common import HOST_ADDRESS
|
from common import HOST_ADDRESS
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
def test_upload_document_with_success(get_api_key_fixture):
|
def test_upload_document_with_success(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -58,6 +75,7 @@ def test_delete_documents_in_dataset_with_success(get_api_key_fixture):
|
|||||||
docs = ds.upload_documents(document_infos)
|
docs = ds.upload_documents(document_infos)
|
||||||
ds.delete_documents([docs[0].id])
|
ds.delete_documents([docs[0].id])
|
||||||
|
|
||||||
|
|
||||||
# upload and parse the document with different in different parse method.
|
# upload and parse the document with different in different parse method.
|
||||||
def test_upload_and_parse_pdf_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_pdf_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
@ -70,6 +88,7 @@ def test_upload_and_parse_pdf_documents_with_general_parse_method(get_api_key_fi
|
|||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_docx_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_docx_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -80,6 +99,8 @@ def test_upload_and_parse_docx_documents_with_general_parse_method(get_api_key_f
|
|||||||
docs = ds.upload_documents(document_infos)
|
docs = ds.upload_documents(document_infos)
|
||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_excel_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_excel_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -90,6 +111,8 @@ def test_upload_and_parse_excel_documents_with_general_parse_method(get_api_key_
|
|||||||
docs = ds.upload_documents(document_infos)
|
docs = ds.upload_documents(document_infos)
|
||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_ppt_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_ppt_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -100,6 +123,8 @@ def test_upload_and_parse_ppt_documents_with_general_parse_method(get_api_key_fi
|
|||||||
docs = ds.upload_documents(document_infos)
|
docs = ds.upload_documents(document_infos)
|
||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_image_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_image_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -110,6 +135,8 @@ def test_upload_and_parse_image_documents_with_general_parse_method(get_api_key_
|
|||||||
docs = ds.upload_documents(document_infos)
|
docs = ds.upload_documents(document_infos)
|
||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_txt_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_txt_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -120,6 +147,8 @@ def test_upload_and_parse_txt_documents_with_general_parse_method(get_api_key_fi
|
|||||||
docs = ds.upload_documents(document_infos)
|
docs = ds.upload_documents(document_infos)
|
||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_md_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_md_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -131,6 +160,7 @@ def test_upload_and_parse_md_documents_with_general_parse_method(get_api_key_fix
|
|||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_json_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_json_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
@ -142,6 +172,7 @@ def test_upload_and_parse_json_documents_with_general_parse_method(get_api_key_f
|
|||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="")
|
@pytest.mark.skip(reason="")
|
||||||
def test_upload_and_parse_eml_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_eml_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
@ -154,6 +185,7 @@ def test_upload_and_parse_eml_documents_with_general_parse_method(get_api_key_fi
|
|||||||
doc = docs[0]
|
doc = docs[0]
|
||||||
ds.async_parse_documents([doc.id])
|
ds.async_parse_documents([doc.id])
|
||||||
|
|
||||||
|
|
||||||
def test_upload_and_parse_html_documents_with_general_parse_method(get_api_key_fixture):
|
def test_upload_and_parse_html_documents_with_general_parse_method(get_api_key_fixture):
|
||||||
API_KEY = get_api_key_fixture
|
API_KEY = get_api_key_fixture
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
|
@ -1,3 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
from ragflow_sdk import RAGFlow, Agent
|
from ragflow_sdk import RAGFlow, Agent
|
||||||
from common import HOST_ADDRESS
|
from common import HOST_ADDRESS
|
||||||
import pytest
|
import pytest
|
||||||
@ -96,12 +112,14 @@ def test_list_sessions_with_success(get_api_key_fixture):
|
|||||||
assistant.create_session("test_2")
|
assistant.create_session("test_2")
|
||||||
assistant.list_sessions()
|
assistant.list_sessions()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="")
|
@pytest.mark.skip(reason="")
|
||||||
def test_create_agent_session_with_success(get_api_key_fixture):
|
def test_create_agent_session_with_success(get_api_key_fixture):
|
||||||
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
||||||
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
rag = RAGFlow(API_KEY, HOST_ADDRESS)
|
||||||
Agent.create_session("2e45b5209c1011efa3e90242ac120006", rag)
|
Agent.create_session("2e45b5209c1011efa3e90242ac120006", rag)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="")
|
@pytest.mark.skip(reason="")
|
||||||
def test_create_agent_conversation_with_success(get_api_key_fixture):
|
def test_create_agent_conversation_with_success(get_api_key_fixture):
|
||||||
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
||||||
@ -109,6 +127,7 @@ def test_create_agent_conversation_with_success(get_api_key_fixture):
|
|||||||
session = Agent.create_session("2e45b5209c1011efa3e90242ac120006", rag)
|
session = Agent.create_session("2e45b5209c1011efa3e90242ac120006", rag)
|
||||||
session.ask("What is this job")
|
session.ask("What is this job")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="")
|
@pytest.mark.skip(reason="")
|
||||||
def test_list_agent_sessions_with_success(get_api_key_fixture):
|
def test_list_agent_sessions_with_success(get_api_key_fixture):
|
||||||
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
API_KEY = "ragflow-BkOGNhYjIyN2JiODExZWY5MzVhMDI0Mm"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user