Skip to content

Instantly share code, notes, and snippets.

@FredrikOseberg
Last active January 31, 2025 18:24
Show Gist options
  • Save FredrikOseberg/c1e8ec83ade6e89ca84882e33caf599c to your computer and use it in GitHub Desktop.
Save FredrikOseberg/c1e8ec83ade6e89ca84882e33caf599c to your computer and use it in GitHub Desktop.
// MessageParser starter code
class MessageParser {
constructor(actionProvider, state) {
this.actionProvider = actionProvider;
this.state = state;
}
parse(message) {
console.log(message)
}
}
export default MessageParser;
// ActionProvider starter code
class ActionProvider {
constructor(
createChatBotMessage,
setStateFunc,
createClientMessage,
stateRef,
createCustomMessage,
...rest
) {
this.createChatBotMessage = createChatBotMessage;
this.setState = setStateFunc;
this.createClientMessage = createClientMessage;
this.stateRef = stateRef;
this.createCustomMessage = createCustomMessage;
}
}
export default ActionProvider;
// Config starter code
import { createChatBotMessage } from "react-chatbot-kit";
const config = {
initialMessages: [createChatBotMessage(`Hello world`)]
}
export default config
@zmoshansky
Copy link

@Iymanjpmc
The following css should give nicer output from the LLM.

.react-chatbot-kit-chat-bot-message {
    white-space: pre-wrap;
}

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