Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: In the Agent's workflow, the input content cannot be wrapped, and \n will not work, otherwise an error will be reported #6241

Closed
4 tasks done
hero8152 opened this issue Mar 18, 2025 · 4 comments

Comments

@hero8152
Copy link

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (Language Policy).
  • Non-english title submitions will be closed directly ( 非英文标题的提交将会被直接关闭 ) (Language Policy).
  • Please do not modify this template :) and fill in all the required fields.

RAGFlow workspace code commit ID

erro

RAGFlow image version

0.17.2 full

Other environment information

Actual behavior

Very serious bug!
When creating a knowledge base in Agent, if line breaks or even \n characters appear in the text entered in the knowledge base, the knowledge base node will report an error, but other nodes will not be affected.
And when the knowledge base matches knowledge, it will only match the characters before the line break, and the text after it will not be read.
If you do not use Agent, create an assistant in the conversation, and enter \n \t in the chat box, it will also become a line break and indentation.

Expected behavior

No response

Steps to reproduce

Interface - Retieval - Generate - Interface

"hello world" - true

"hello
world" -false

Additional information

No response

@KevinHuSh
Copy link
Collaborator

Sorry, I didn't quite follow.
How to reprodue it and what's the problems?
Let take chat assistant for an example.

  1. Create a assistant.
  2. Enter \n or \t in the chat box.
    Then, ...

@hero8152
Copy link
Author

如果是用聊天窗口的话,输入框没有设置成纯文本格式,所以如果在聊天框里面输入\n,他就会换行,这是不合理的一个点。

最严重的是agent,如果你创建一个带知识库的工作流,连接方式为:开始 > 对话 > 知识库 > 生成回答 > 对话,知识库的input为对话。

当你连接好后,点击测试,粘贴不带任何格式和换行的纯文本(比如:今天天气很好,啊对对对),可以正常运行,并且知识库搜索结果良好。如果粘贴的是带换行的内容(比如:今天
天气很好,啊对对对),在知识库那一步,就会报错ERRO!(不论是文本中直接换行,还是文本中打字\n,都会出错)。

这个bug导致的结果是,知识库检索会出现截断。
比如:今\n天天气很好,那么他百分百报错erro,猜测是只给知识库输入了“今”,导致有效信息太少,知识库没法检索。
比如:今天天气\n很好,那么他可能就只会搜索“今天天气”,然后给你返回相关的结果,后面的“很好”不会被输入知识库。

我在excel里面批量把换行符替换成空格后,测试就再也没报错了。

另外还有一个问题是:输出的结果也不是纯文本,比方说他会把链接藏在文字里面,点击文字跳转。但是文字没有下划线,也没有颜色区分,所以根本看不出来。还有例如粗体这种格式,最后粘贴出来会是粗体字这种※的格式。

最后就是使用Python调用agant,文档根本没有提及,最后才用的是野路子,打开嵌入网页的那个192链接,在网页对话的时候解析出来的cookie和session等,使用python模拟这个请求过程。而且为了防止单个窗口出现连续对话的问题,是先用Python请求一个新的session,然后再运行Agent,总之非常难受。

@hero8152
Copy link
Author

Sorry, I didn't quite follow.抱歉,我没有完全跟上。 How to reprodue it and what's the problems?如何重现它,问题是什么? Let take chat assistant for an example.让我们以聊天助手为例。

  1. Create a assistant.  创建助手。
  2. Enter \n or \t in the chat box.在聊天框中输入 \n 或 \t。
    Then, ...  然后。。。

@hero8152
Copy link
Author

Sorry, I didn't quite follow.抱歉,我没有完全跟上。 How to reprodue it and what's the problems?如何重现它,问题是什么? Let take chat assistant for an example.让我们以聊天助手为例。

  1. Create a assistant.  创建助手。
  2. Enter \n or \t in the chat box.在聊天框中输入 \n 或 \t。
    Then, ...  然后。。。

点错了关闭了。。

cike8899 added a commit to cike8899/ragflow that referenced this issue Mar 19, 2025
…d \n will not work, otherwise an error will be reported infiniflow#6241
KevinHuSh pushed a commit that referenced this issue Mar 19, 2025
…d \n will not work, otherwise an error will be reported #6241 (#6284)

### What problem does this PR solve?

Fix: In the Agent's workflow, the input content cannot be wrapped, and
\n will not work, otherwise an error will be reported #6241

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
liwenju0 pushed a commit to liwenju0/ragflow that referenced this issue Mar 20, 2025
…d \n will not work, otherwise an error will be reported infiniflow#6241 (infiniflow#6284)

### What problem does this PR solve?

Fix: In the Agent's workflow, the input content cannot be wrapped, and
\n will not work, otherwise an error will be reported infiniflow#6241

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants