$.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);
}
});
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
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
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
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
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
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:
<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>
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
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