Skip to content

Commit cddfc2f

Browse files
author
virgilwong
committed
Merge commit '44dec89f1fd6eb98f2d8d5c0137074990a09a99c' into feature/support_encrypted_files_20251209
* commit '44dec89f1fd6eb98f2d8d5c0137074990a09a99c': (28 commits) Fix: aspose-slide issue. (infiniflow#11935) Fix: raptor don't have attribute chat (infiniflow#11936) Feat: Add GPT-5.2 & pro (infiniflow#11929) Refa: refactor metadata filter (infiniflow#11907) Feat: Displaying the file option in the webhook's request body infiniflow#10427 (infiniflow#11928) Fix: forget-reset password (infiniflow#11927) Feature/docs generator (infiniflow#11858) Fix: correct metadata update behavior (infiniflow#11919) Docs: How to use restful API to update or delete metadata (infiniflow#11912) Feat: Add box connector (infiniflow#11845) Feat: Flatten the request schema of the webhook infiniflow#10427 (infiniflow#11917) feat: Add Single Bucket Mode for MinIO/S3 (infiniflow#11416) Fix: tokenizer issue. (infiniflow#11902) Feat: Add mineru as a model manufacturer to the system. infiniflow#10621 (infiniflow#11903) Refa: treat MinerU as an OCR model 2 (infiniflow#11905) Add DeepseekV3.2 of Tongyi-Qianwen and remove unused code (infiniflow#11898) Fix:async issue and sensitive logging (infiniflow#11895) Added semi-automatic mode to the metadata filter (infiniflow#11886) Fix data_sync startup crash by properly invoking async main (infiniflow#11879) MinerU supports for the new backend vlm-mlx-engine (infiniflow#11864) ... # Conflicts: # docker/.env # pyproject.toml
2 parents fc333aa + 44dec89 commit cddfc2f

File tree

159 files changed

+8961
-1379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+8961
-1379
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: tests
2+
permissions:
3+
contents: read
24

35
on:
46
push:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,6 @@ ragflow_cli.egg-info
195195

196196
# Default backup dir
197197
backup
198+
199+
200+
.hypothesis

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked \
5252
apt install -y nginx unzip curl wget git vim less && \
5353
apt install -y ghostscript && \
5454
apt install -y pandoc && \
55-
apt install -y texlive
55+
apt install -y texlive && \
56+
apt install -y fonts-freefont-ttf fonts-noto-cjk
5657

5758
# Install uv
5859
RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/,target=/deps \

admin/client/admin_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ def parse_command(self, command_str: str) -> dict[str, str]:
351351
def verify_admin(self, arguments: dict, single_command: bool):
352352
self.host = arguments['host']
353353
self.port = arguments['port']
354-
print(f"Attempt to access ip: {self.host}, port: {self.port}")
354+
print("Attempt to access server for admin login")
355355
url = f"http://{self.host}:{self.port}/api/v1/admin/login"
356356

357357
attempt_count = 3
@@ -390,7 +390,7 @@ def verify_admin(self, arguments: dict, single_command: bool):
390390
print(f"Bad response,status: {response.status_code}, password is wrong")
391391
except Exception as e:
392392
print(str(e))
393-
print(f"Can't access {self.host}, port: {self.port}")
393+
print("Can't access server for admin login (connection failed)")
394394

395395
def _format_service_detail_table(self, data):
396396
if isinstance(data, list):
@@ -674,7 +674,7 @@ def _handle_alter_user(self, command):
674674
user_name: str = user_name_tree.children[0].strip("'\"")
675675
password_tree: Tree = command['password']
676676
password: str = password_tree.children[0].strip("'\"")
677-
print(f"Alter user: {user_name}, password: {password}")
677+
print(f"Alter user: {user_name}, password: ******")
678678
url = f'http://{self.host}:{self.port}/api/v1/admin/users/{user_name}/password'
679679
response = self.session.put(url, json={'new_password': encrypt(password)})
680680
res_json = response.json()
@@ -689,7 +689,7 @@ def _handle_create_user(self, command):
689689
password_tree: Tree = command['password']
690690
password: str = password_tree.children[0].strip("'\"")
691691
role: str = command['role']
692-
print(f"Create user: {user_name}, password: {password}, role: {role}")
692+
print(f"Create user: {user_name}, password: ******, role: {role}")
693693
url = f'http://{self.host}:{self.port}/api/v1/admin/users'
694694
response = self.session.post(
695695
url,
@@ -951,7 +951,7 @@ def main():
951951

952952
args = cli.parse_connection_args(sys.argv)
953953
if 'error' in args:
954-
print(f"Error: {args['error']}")
954+
print("Error: Invalid connection arguments")
955955
return
956956

957957
if 'command' in args:
@@ -960,7 +960,7 @@ def main():
960960
return
961961
if cli.verify_admin(args, single_command=True):
962962
command: str = args['command']
963-
print(f"Run single command: {command}")
963+
# print(f"Run single command: {command}")
964964
cli.run_single_command(command)
965965
else:
966966
if cli.verify_admin(args, single_command=False):

admin/server/auth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,11 @@ def decorated(*args, **kwargs):
176176
"message": "Access denied",
177177
"data": None
178178
}), 200
179-
except Exception as e:
180-
error_msg = str(e)
179+
except Exception:
180+
logging.exception("An error occurred during admin login verification.")
181181
return jsonify({
182182
"code": 500,
183-
"message": error_msg
183+
"message": "An internal server error occurred."
184184
}), 200
185185

186186
return f(*args, **kwargs)

agent/component/agent_with_tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def _react_with_tools_streamly_async(self, prompt, history: list[dict], us
271271
last_calling = ""
272272
if len(hist) > 3:
273273
st = timer()
274-
user_request = await asyncio.to_thread(full_question, messages=history, chat_mdl=self.chat_mdl)
274+
user_request = await full_question(messages=history, chat_mdl=self.chat_mdl)
275275
self.callback("Multi-turn conversation optimization", {}, user_request, elapsed_time=timer()-st)
276276
else:
277277
user_request = history[-1]["content"]
@@ -309,7 +309,7 @@ async def complete():
309309
if len(hist) > 12:
310310
_hist = [hist[0], hist[1], *hist[-10:]]
311311
entire_txt = ""
312-
async for delta_ans in self._generate_streamly_async(_hist):
312+
async for delta_ans in self._generate_streamly(_hist):
313313
if not need2cite or cited:
314314
yield delta_ans, 0
315315
entire_txt += delta_ans
@@ -397,7 +397,7 @@ async def _gen_citations_async(self, text):
397397
retrievals = self._canvas.get_reference()
398398
retrievals = {"chunks": list(retrievals["chunks"].values()), "doc_aggs": list(retrievals["doc_aggs"].values())}
399399
formated_refer = kb_prompt(retrievals, self.chat_mdl.max_length, True)
400-
async for delta_ans in self._generate_streamly_async([{"role": "system", "content": citation_plus("\n\n".join(formated_refer))},
400+
async for delta_ans in self._generate_streamly([{"role": "system", "content": citation_plus("\n\n".join(formated_refer))},
401401
{"role": "user", "content": text}
402402
]):
403403
yield delta_ans

agent/component/categorize.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
import asyncio
1617
import logging
1718
import os
1819
import re
@@ -97,7 +98,7 @@ class Categorize(LLM, ABC):
9798
component_name = "Categorize"
9899

99100
@timeout(int(os.environ.get("COMPONENT_EXEC_TIMEOUT", 10*60)))
100-
def _invoke(self, **kwargs):
101+
async def _invoke_async(self, **kwargs):
101102
if self.check_if_canceled("Categorize processing"):
102103
return
103104

@@ -121,7 +122,7 @@ def _invoke(self, **kwargs):
121122
if self.check_if_canceled("Categorize processing"):
122123
return
123124

124-
ans = chat_mdl.chat(self._param.sys_prompt, [{"role": "user", "content": user_prompt}], self._param.gen_conf())
125+
ans = await chat_mdl.async_chat(self._param.sys_prompt, [{"role": "user", "content": user_prompt}], self._param.gen_conf())
125126
logging.info(f"input: {user_prompt}, answer: {str(ans)}")
126127
if ERROR_PREFIX in ans:
127128
raise Exception(ans)
@@ -144,5 +145,9 @@ def _invoke(self, **kwargs):
144145
self.set_output("category_name", max_category)
145146
self.set_output("_next", cpn_ids)
146147

148+
@timeout(int(os.environ.get("COMPONENT_EXEC_TIMEOUT", 10*60)))
149+
def _invoke(self, **kwargs):
150+
return asyncio.run(self._invoke_async(**kwargs))
151+
147152
def thoughts(self) -> str:
148153
return "Which should it falls into {}? ...".format(",".join([f"`{c}`" for c, _ in self._param.category_description.items()]))

0 commit comments

Comments
 (0)