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

The 'inputs' field in /chat-messages takes effect only for the first time #7952

Closed
5 tasks done
Wu-Jiayang opened this issue Sep 4, 2024 · 1 comment · May be fixed by #7955
Closed
5 tasks done

The 'inputs' field in /chat-messages takes effect only for the first time #7952

Wu-Jiayang opened this issue Sep 4, 2024 · 1 comment · May be fixed by #7955
Labels
🐞 bug Something isn't working

Comments

@Wu-Jiayang
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.7.3

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

run API '/chat-messages' twice with different 'inputs' and same 'conversation_id'

✔️ Expected Behavior

Run with the correct 'inputs'

❌ Actual Behavior

Run with the first 'inputs'.

This is caused by

inputs=conversation.inputs if conversation else self._get_cleaned_inputs(inputs, app_config),

Copy link

dosubot bot commented Sep 4, 2024

@Wu-Jiayang Hello! I'm here to help you with bug fixes, answer questions, and support you in becoming a contributor. Let me know how I can assist you while you wait for a human maintainer.

I found a similar closed issue: Why doesn't the /chat-messages API allow passes context messages as a list?. However, it has no comments or solution and was last updated on April 26, 2024 [1].

The behavior you're experiencing is due to how the conversation_id is used to maintain the context of the conversation. Once a conversation is initiated with a specific conversation_id, subsequent messages within the same conversation continue the context from the initial message, and the inputs field from the first message is retained [2].

There is a state management system in place that might cause the inputs to be reused for the same conversation_id. The session is maintained by continuously passing in the returned conversation_id, which implies that the state of the conversation, including inputs, is managed and reused based on the conversation_id [3][4][5][6].

Recent changes in the app_generator.py file could also affect the handling of inputs. Specifically, the inputs are processed and cleaned using the _get_cleaned_inputs method before being used in the AgentChatAppGenerateEntity initialization [7][8][9].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the 🐞 bug Something isn't working label Sep 4, 2024
@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 5, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant