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

Render "Talk to Person" button #25

Closed
svenseeberg opened this issue Jul 22, 2024 · 7 comments · Fixed by #118 · May be fixed by digitalfabrik/integreat-cms#3362
Closed

Render "Talk to Person" button #25

svenseeberg opened this issue Jul 22, 2024 · 7 comments · Fixed by #118 · May be fixed by digitalfabrik/integreat-cms#3362
Assignees
Labels
component:chat Chat Back End component:cms Integreat CMS enhancement New feature or request prio:medium

Comments

@svenseeberg
Copy link
Member

Automatic answers should contain a button "talk to human". This will be normal HTML and the app has to render it as a button that triggers a specific message (i.e. "User wants to talk to human").

Zammad can use this text with a trigger to forward the issue to a human.

@svenseeberg svenseeberg added this to the v3 Basic Answer Retrieval milestone Jul 22, 2024
@svenseeberg svenseeberg added the enhancement New feature or request label Jul 22, 2024
@svenseeberg svenseeberg mentioned this issue Oct 1, 2024
5 tasks
@svenseeberg
Copy link
Member Author

Alternative: new / amended Integreat CMS API endpoint that does something special to Zammad.

@svenseeberg
Copy link
Member Author

svenseeberg commented Oct 2, 2024

Do we need other buttons as well? We should probably discuss some kind of "actions schema". Currently, the API response contains a messages attribute. We could add an available_actions attribute?

{
  "messages": [],
  "available_actions": ["request_human", "end_chat"],
}

Alternatively, the actions could be per message, and usually only the actions for the latest message are rendered/shown.

@svenseeberg svenseeberg added component:app Integreat App component:cms Integreat CMS labels Oct 4, 2024
@svenseeberg
Copy link
Member Author

Alternatively, we could add a new attribute to our Zammad issues, which indicated that the chat bot should not answer at all. We can then add an info to the first automatic answer that the user can always request to talk/write to a human. We can have an LLM evaluate each message if the user wants that and in such a case set the "silence bot" attribute in Zammad. Zammad can then have a trigger bumping this issue to a human.

@dasgoutam
Copy link
Collaborator

I've created basic structure in the PR for checking if the user requests to talk to a human before triggering the answer generation.

The next step would be to trigger an attribute in Zammad. @svenseeberg can you help me out on that.

Secondly, how would the chat continue after the user has requested a human intervention? Should we add a generic json response for now?

@svenseeberg
Copy link
Member Author

Additional fields in Zammad can be configured in the system settings -> Objects. I added a new field automatic_answer on https://zammad-integreat.tuerantuer.org used in testumgebung:

image

@svenseeberg
Copy link
Member Author

svenseeberg commented Jan 7, 2025

The attribute should now be contained in Webhooks to the Integreat CMS. This can be used/parsed in https://github.com/digitalfabrik/integreat-cms/blob/develop/integreat_cms/api/v3/chat/user_chat.py#L237-L257

The chat back end has to return the attribute in the extract_answer view and we have to update the Zammad ticket attribute after processing the user message in https://github.com/digitalfabrik/integreat-cms/blob/develop/integreat_cms/api/v3/chat/utils/chat_bot.py#L79-L109

@svenseeberg
Copy link
Member Author

Fun fact: We can now add a button in the app that simply sends a plain "I want to talk to a human" message ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment