chore: update 1 file(s)

This commit is contained in:
mike
2025-12-28 04:20:00 +01:00
parent c81958d000
commit cea5d50fa6

View File

@@ -15,11 +15,29 @@ const BACKENDS = {
name: 'Ollama (192.168.1.159:8081)'
}
}
const IS_PRODUCTION = window.location.hostname === 'jarvis-lan.appmodel.nl'
const API_KEY = 'not-needed'
const MAX_CHAT_HISTORY = 50
const welcomeMessage = `# Welcome to LM Studio Chat!
I now support **full conversation history**, **real-time streaming responses** and **dark, readable text formatting**.
## Features:
1. **Full Chat History** - Complete conversation context is now sent to the AI
2. **Smart History Management** - Automatically keeps the last ${ MAX_CHAT_HISTORY } messages
3. **Streaming Mode** (enabled by default) - Watch responses appear word-by-word
4. **Markdown Rendering** - Proper formatting for code, lists, tables, and more
5. **Readable Dark Text** - No more eye strain from light gray text
## Try it out:
- Ask follow-up questions that reference earlier messages
- Have a multi-turn conversation with full context
- Ask "what did I just ask?" to test history retention
- Watch the streaming response in real-time!
> *Tip: You can toggle streaming and markdown using the checkboxes below.*`
let currentBackend = 'plato'
let currentModel = null
let availableModels = []
@@ -454,6 +472,7 @@ async function handleStreamingResponse(userMessage) {
}
async function handleNonStreamingResponse(userMessage) {
try {
const typingIndicator = showTypingIndicator()
if (!currentModel && availableModels.length > 0) {
@@ -500,6 +519,7 @@ async function handleNonStreamingResponse(userMessage) {
sendBtn.disabled = false
userInput.focus()
}
}
function stopStream() {
if (currentStreamController) {
@@ -559,7 +579,7 @@ window.onload = () => {
function resetChat() {
chatHistory = []
chatLog.innerHTML = ''
chatLog.innerHTML = welcomeMessage
localStorage.setItem('chatHistory', JSON.stringify(chatHistory))
}