Telerik Forums
Kendo UI for jQuery Forum
0 answers
16 views
Hello Everyone, 
I use Kendo Chat. the user writes a text (promt). this prompt goes to my endpoint and returns a response. i print this response back to the chat, but there is a problem. for example, the incoming text : 
"
This is a sample article. Sample text.
Sample text on the second line.
Sample text in the third line.
Sample text in the fourth line.
"
This is what the output looks like when I print it: 
"
This is a sample article. Sample text, sample text on the second line, sample text on the third line, sample text on the fourth line.
"

I'm tired of searching for a solution. I can't find it.
My code snippet: 



  $.ajax({
            url: SendPrompt.fmt(encodedMessage, encodedUserName), 
            async: true,
            contentType: 'application/json',
            type: "POST",
            dataType: "json",
            processData: false,          
            headers: { Authorization: tokenData() },
            beforeSend: setHeader,
            success: function (data) { 
                    var answer = data.Answer.replace(/(?:\r\n|\r|\n)/g, '\n\n');                   
                chat.renderMessage({
                    type: "MyText",
                    text: answer 
                }, {
                    id: kendo.guid(),
                    name: gptName
                });
            }, error: function (jqXHR, textStatus, errorThrown) {
                console.log("Status:", textStatus);
            },
            complete: function () {
                messageTemplate.animate({ opacity: 0 }, 500, function () {
                    $(this).css({ display: 'none' });
                });
                chat.wrapper.find(".k-input").prop('disabled', false);
                chat.wrapper.find(".k-button-send").prop('disabled', false);
            }
        });

Please help me..
Deniz
Top achievements
Rank 1
 asked on 21 Mar 2024
2 answers
103 views

Hello,

I am using the jquery chat widget as a virtual assistant on the right corner of the page and would like the ability change the message box to a textarea as opposed to an input so all the wording that is outside the scrollable view area is visible.

I see in the angular version of this widget that this is possible, is there a similar feature for the jquery chat version?  Or even the .net Core version?

Thanks,

Arthur

Jeff
Top achievements
Rank 1
Iron
 answered on 11 Jan 2024
1 answer
33 views

Hey everybody! 

There must be something simple that I am missing.

I currently have a template set up to render through renderMessage() which runs for every message on initialization. 
Loosely based on this. Thank you Martin for this one.
https://www.telerik.com/forums/set-date-on-rendermessage-in-kendochat

The issue is that when I hit the send button and it goes into the post() method, this template no longer applies and it seems to reverts back to default.

How do I wire up my template to be used by default on send button click? 

Best, 
Jeff 

Jeff
Top achievements
Rank 1
Iron
 answered on 11 Jan 2024
1 answer
66 views

We are exploring using Kendo Chat for JQuery to support LLM interactions but are finding the control very limiting compared to Bootstrap 5 MDB.  Does anyone know if you can:

  • support bold and rich html formatting within the chat messages?  The LLM is correctly responding with formatting such as <strong> but this is not respected within the control.
  • add ability to pass additional data in the chat post - doing this results in [Object, Object] in the chat window itself

 

Neli
Telerik team
 answered on 16 Nov 2023
1 answer
69 views
Hi,

When I use the chat widget to send a message, it triggers the post event. I hope to display the User Typing Indicator using the renderUserTypingIndicator method within the onPost function, but it seems to have no effect? However, testing the renderUserTypingIndicator within $(document).ready seems to work. Have I misunderstood the usage method?

 

<div id="chat"></div>
<script>

    $(document).ready(function () {

        var chat = $("#chat").kendoChat({
            post: onPost
        }).data("kendoChat");

        chat.renderMessage({
            type: "text",
            text: "Hello, how can I assist you today?",
            timestamp: new Date()
        }, {
            name: "Chatbot"
        });


        function onPost(args) {
            var chatargs = args.sender;
            var chat = $("#chat").data("kendoChat");

            // Render the typing indicator.
            chat.renderUserTypingIndicator({ name: "Chatbot" });

        }

    });

</script>

Martin
Telerik team
 answered on 17 Jul 2023
2 answers
317 views

Hello, I'm trying to prevent chat posting, I mean when user click send button (or type keybord enter) I want in some cases to prevent the post of the message.
Something like this is not working (the message is posted in chat)

$("#chat").kendoChat({
    post: function(e) {
        e.preventDefault();       
    }
});

Is that a bug? Or there is a different approach to accomplish this task?
Thanks,
Mattia

Jeff
Top achievements
Rank 1
Iron
 updated answer on 30 Mar 2023
2 answers
87 views

What is the best way to customize the timestamp location and format?

We've tried using templates but can only control those rendered from chat.renderMessage, it's not clear how to use a different template from the user's posted message (ie we only know how to control the left-side not the right-side message bubbles)

The documentation has no information on this and were only able to piece together from other forum posts

Peter Milchev
Telerik team
 answered on 27 Dec 2022
0 answers
110 views

Hi, I have a problem like this the image,

how can I fix this labels overlap issue,'m using kendo jquery ui

Thanks...

Chiran
Top achievements
Rank 1
Iron
Iron
 asked on 10 Dec 2021
1 answer
219 views

Is there a way to set the date on the renderMessage method.  I'm using the renderMessage to pre-populate the chat instance with a predefined, persistent chat message.  When you click on the chat bubble, it shows you the time in hh:mm:ss format.

I'm curious, is there a way to set the date on the renderMessage.  If yes, can you control what shows up when you click on it (i.e. old stuff, you most likely want to see the time.

Thanks,

Richard

Martin
Telerik team
 answered on 16 Nov 2021
5 answers
515 views

Hello!
I need a feature for this chat control that is present in Kendo Angular library (https://www.telerik.com/kendo-angular-ui/components/conversationalui/message-templates/)
I'm talking about message templates: the possibility to add a custom template in normal message.
I need it to implement some advance features, like messages deletion and messages modification.

This feature will be present soon in Kendo jQuery library?

Thanks,
Mattia

Damian
Top achievements
Rank 1
Iron
 answered on 07 Jul 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?