Telerik Forums
Kendo UI for jQuery Forum
1 answer
220 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..
Heythem
Top achievements
Rank 1
Iron
 answered on 10 Apr 2025
1 answer
47 views

Hi,

Does the chat control support rendering messages that are in Markdown format? For Example:

**James Smith**

- Department: Development

- Role: Senior Developer

This should show James Smith in bold. If the chat control does not support this can you suggest any approaches to achive this?

Thanks,

Euan

Martin
Telerik team
 answered on 06 Feb 2025
1 answer
57 views

Hi,

I was wondering if it was possible to display an image as a response in the Chat control? For example, respond with a png to a users question as oppose to a textual respone. I noticed the renderAttachments method but I am not sure if that is the correct approach.

Thanks,

Euan

Neli
Telerik team
 answered on 18 Nov 2024
2 answers
252 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
 updated answer on 02 Jul 2024
1 answer
72 views

Hi,

I know that there are hacky workarounds to still achieve this, but I was wondering if you could add this to your api please. At present if you change your chat widget then someone will probably need to change our code also.

For example, we load 10 chat messages at a time and when the user scrolls to the top we get the next 10 messages and prepend them to the top of the list and update the scrollbar position accordingly. If we use your api all messages are added to the bottom.

Cheers

Simon

Neli
Telerik team
 answered on 07 Jun 2024
1 answer
107 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
325 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
187 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
511 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
240 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?