read apikey from url
This commit is contained in:
13
index.html
13
index.html
@ -194,7 +194,14 @@
|
||||
|
||||
<script>
|
||||
const API_URL = 'https://lmstudio.yasue.org/v1/chat/completions';
|
||||
const API_KEY = 'pGYqv9Y1u6FKN6ER6xqqv6dXxUhoeHX4';
|
||||
|
||||
// Read API key from URL query parameter
|
||||
function getApiKeyFromUrl() {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
return urlParams.get('apikey');
|
||||
}
|
||||
|
||||
const API_KEY = getApiKeyFromUrl() || 'pGYqv9Y1u6FKN6ER6xqqv6dXxUhoeHX4';
|
||||
const MODEL = 'openai/gpt-oss-20b';
|
||||
|
||||
let messages = [
|
||||
@ -267,8 +274,8 @@
|
||||
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center shadow-sm ${isUser ? 'bg-indigo-600' : 'bg-gray-700 border border-gray-600'}">
|
||||
<i data-lucide="${isUser ? 'user' : 'bot'}" class="${isUser ? 'text-white' : 'text-indigo-400'} w-4 h-4"></i>
|
||||
</div>
|
||||
<div class="flex flex-col flex-1 ${isUser ? 'items-end' : 'items-start'}">
|
||||
<div class="px-4 py-2.5 rounded-2xl shadow-sm text-sm max-w-full overflow-hidden ${isUser ? 'bg-indigo-600 text-white rounded-tr-none' : 'bg-gray-800 text-gray-100 border border-gray-700 rounded-tl-none'}">
|
||||
<div class="flex flex-col flex-1">
|
||||
<div class="px-4 py-2.5 rounded-2xl shadow-sm text-sm w-full overflow-hidden ${isUser ? 'bg-indigo-600 text-white rounded-tr-none' : 'bg-gray-800 text-gray-100 border border-gray-700 rounded-tl-none'}">
|
||||
${formattedContent}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user