Help
RSS
API
Feed
Maltego
Contact
Domain > ai.anamulhaque.workers.dev
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2025-06-06
104.21.47.13
(
ClassC
)
2026-03-04
172.67.143.160
(
ClassC
)
Port 80
HTTP/1.1 200 OKDate: Wed, 04 Mar 2026 20:21:01 GMTContent-Type: text/htmlContent-Length: 16804Connection: keep-aliveReport-To: {group:cf-nel,max_age:604800,endpoints:{url:https://a.nel.cloudflare.com/report/v4?sIT%2Bm%2F5Ri%2ByjlkiHDK0AoJNS17VgG5CSesME0LHbJ7xFOLEXq8Y3JvQwKsC%2FutPi3oRNs7jShy54LOrZWDLlFN8ZkQ56Fd3DN5y9xLiZEdat8WaLFnlqovrl1}}Nel: {report_to:cf-nel,success_fraction:0.0,max_age:604800}Server: cloudflareCF-RAY: 9d7395ba89a36c17-PDXalt-svc: h3:443; ma86400 !DOCTYPE html>html langen>head> meta charsetUTF-8> meta nameviewport contentwidthdevice-width, initial-scale1.0> title>Workers AI Chat Demo/title> script srchttps://cdn.jsdelivr.net/npm/marked/marked.min.js>/script> style> :root { --md-sys-color-primary: #ffffff; --md-sys-color-on-primary: #000000; --md-sys-color-primary-container: #333333; --md-sys-color-on-primary-container: #ffffff; --md-sys-color-secondary: #D7C1D2; --md-sys-color-on-secondary: #3B2D3A; --md-sys-color-secondary-container: #524351; --md-sys-color-on-secondary-container: #F4DDEE; --md-sys-color-tertiary: #F5B8B5; --md-sys-color-on-tertiary: #4C2524; --md-sys-color-tertiary-container: #663B39; --md-sys-color-on-tertiary-container: #FFDAD8; --md-sys-color-error: #FFB4AB; --md-sys-color-on-error: #690005; --md-sys-color-background: #111316; --md-sys-color-on-background: #e2e2e6; --md-sys-color-surface: #111316; --md-sys-color-on-surface: #e2e2e6; --md-sys-color-surface-variant: #333639; --md-sys-color-on-surface-variant: #909499; --md-sys-color-outline: #5c6166; --md-sys-color-outline-variant: #5c6166; --md-sys-color-surface-container: #1d2023; --md-sys-color-surface-container-high: #333639; --md-sys-color-code-bg: #000; --md-sys-color-code-text: #e2e2e6; }* { box-sizing: border-box;}body { font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif; margin: 0; background-color: var(--md-sys-color-background); color: var(--md-sys-color-on-background); display: flex; justify-content: center;}main { width: 100%; max-width: 800px; height: 100dvh; display: flex; flex-direction: column; padding: 1rem; position: relative;}#output { flex-grow: 1; overflow-y: auto; padding: 3.5rem 0.5rem 6rem; display: flex; flex-direction: column; gap: 1rem; scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* IE and Edge */}#output::-webkit-scrollbar { display: none; /* Chrome, Safari, Opera */}@keyframes turn-enter { from { opacity: 0; transform: scale(0.95) translateY(10px); border-radius: 2rem; } to { opacity: 1; transform: scale(1) translateY(0); }}.turn { padding: 1rem; max-width: 90%; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%); line-height: 1.5; animation: turn-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);}.turn.user { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); align-self: flex-end; border-radius: 1.5rem 1.5rem 0.5rem 1.5rem;}.turn.gemini { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); align-self: flex-start; border-radius: 1.5rem 1.5rem 1.5rem 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; position: relative;}.copy-ai-message { position: absolute; bottom: 0.5rem; right: 0.5rem; background: var(--md-sys-color-surface-variant); border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface-variant); border-radius: 6px; padding: 4px 8px; font-size: 0.75rem; cursor: pointer; opacity: 0; transition: opacity 0.2s ease;}.turn.gemini:hover .copy-ai-message { opacity: 1;}.summary { font-size: 0.8rem; opacity: 0.7; border-left: 3px solid var(--md-sys-color-outline); padding-left: 0.75rem; font-style: italic;}#new-chat-button { position: absolute; top: 1rem; left: 1rem; z-index: 10; background: none; border: none; padding: 0.5rem; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--md-sys-color-on-surface-variant);}#new-chat-button:hover { background-color: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);}form { position: absolute; bottom: 1rem; left: 1rem; right: 1rem; display: flex; gap: 0.75rem; padding: 0.75rem; align-items: center; border-radius: 1.75rem; /* 28px */ background-color: var(--md-sys-color-surface-container); box-shadow: 0 4px 8px 3px rgba(0,0,0,0.2);}textarea { flex-grow: 1; padding: 1rem; border-radius: 1.25rem; border: 1px solid var(--md-sys-color-outline-variant); background-color: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-family: inherit; font-size: 1rem; resize: none; max-height: 200px; transition: border-color 0.2s ease, box-shadow 0.2s ease;}textarea:focus { outline: none; border-color: var(--md-sys-color-primary); box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);}button { padding: 1rem 1.5rem; border: none; background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border-radius: 1.25rem; cursor: pointer; font-size: 1rem; font-weight: 700; transition: all 0.2s ease; position: relative; overflow: hidden; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.1), 0 1px 3px 1px rgb(0 0 0 / 0.1); display: flex; align-items: center; justify-content: center;}button:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 1px 3px 1px rgb(0 0 0 / 0.15), 0 2px 6px 2px rgb(0 0 0 / 0.15); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;}button:disabled { background-color: var(--md-sys-color-on-surface); opacity: 0.12; color: var(--md-sys-color-on-surface); box-shadow: none; cursor: not-allowed; transform: scale(1);}.code-container { position: relative;}.copy-button { position: absolute; top: 8px; right: 8px; padding: 4px 8px; border: 1px solid var(--md-sys-color-outline); background-color: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); border-radius: 6px; font-size: 0.75rem; cursor: pointer; opacity: 0.5; transition: opacity 0.2s;}.code-container:hover .copy-button { opacity: 1;}pre { border: 1px solid var(--md-sys-color-outline); padding: 1em; overflow: auto; border-radius: 8px; background-color: var(--md-sys-color-code-bg); color: var(--md-sys-color-code-text);}.ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple 600ms linear; background-color: var(--md-sys-color-on-primary); opacity: 0.4;}@keyframes ripple { to { transform: scale(4); opacity: 0; }}.turn.gemini a { color: var(--md-sys-color-on-surface); text-decoration: none; padding-right: 1.2em; position: relative;}.turn.gemini a::before { content: ; position: absolute; bottom: 0; left: 0; width: calc(100% - 1.2em); border-bottom: 2px dotted currentColor;}.turn.gemini a:hover { color: var(--md-sys-color-primary);}.turn.gemini a::after { content: ↗; position: absolute; right: 0; top: 0; font-size: 0.9em; line-height: 1;}/* Loading Spinner */.button-text { transition: opacity 0.2s ease-in-out;}.spinner { position: absolute; width: 24px; height: 24px; opacity: 0; transition: opacity 0.2s ease-in-out; animation: rotate 2s linear infinite;}.spinner .path { stroke: var(--md-sys-color-on-primary); stroke-linecap: round; animation: dash 1.5s ease-in-out infinite;}button.loading .button-text { opacity: 0;}button.loading .spinner { opacity: 1;}@keyframes rotate { 100% { transform: rotate(360deg); }}@keyframes dash { 0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }} /style>/head>body> main> button idnew-chat-button titleNew Chat> svg xmlnshttp://www.w3.org/2000/svg width24 height24 viewBox0 0 24 24 fillnone strokecurrentColor stroke-width2 stroke-linecapround stroke-linejoinround classicon-new-chat>path dM12 5v14/>path dM5 12h14/>/svg> /button> div idoutput> div classturn gemini> div>Hello! How can I help you today?/div> button classcopy-ai-message titleCopy message>Copy/button> /div> /div> form> textarea placeholderType your message... rows1>/textarea> button typesubmit> span classbutton-text>Send/span> svg classspinner viewBox0 0 50 50> circle classpath cx25 cy25 r20 fillnone stroke-width5>/circle> /svg> /button> /form> /main> script> document.getElementById(new-chat-button).addEventListener(click, () > { window.location.reload(); }); const output document.getElementById(output); output.addEventListener(click, e > { const copyBtn e.target.closest(.copy-ai-message); if (copyBtn) { const turnElement copyBtn.closest(.turn); const content turnElement.querySelector(div:not(.summary)); navigator.clipboard.writeText(content.innerText).then(() > { copyBtn.textContent Copied!; setTimeout(() > { copyBtn.textContent Copy; }, 2000); }).catch(err > { console.error(Failed to copy: , err); }); } }); const form document.querySelector(form); const textarea form.querySelector(textarea); const button form.querySelector(button); // The entire conversation history is stored here let messages { role: system, content: You are a helpful and friendly assistant. }, { role: assistant, content: Hello! How can I help you today? I will stream my responses. } ; form.addEventListener(submit, async (e) > { e.preventDefault(); const userText textarea.value.trim(); if (!userText) return; // Add user message to UI and history addMessage(userText, user); messages.push({ role: user, content: userText }); textarea.value ; // Disable input while waiting for response toggleInput(false); // Create a placeholder for the assistants message const assistantTurnElement addMessage(, assistant); const assistantContentElement assistantTurnElement.querySelector(div); try { const response await fetch(/api/chat, { method: POST, headers: { Content-Type: application/json }, body: JSON.stringify({ messages }) }); if (!response.ok) { const errorData await response.json().catch(() > ({ error: API request failed })); throw new Error(errorData.error || API request failed); } // Handle the non-streaming JSON response const result await response.json(); // Extract and display the summary from the reasoning part of the output const reasoningOutput result.output?.find(o > o.type reasoning); if (reasoningOutput?.content?.0?.text) { const summaryText reasoningOutput.content0.text; const summaryElement document.createElement(div); summaryElement.classList.add(summary); summaryElement.textContent summaryText; assistantTurnElement.prepend(summaryElement); } // The gpt-oss-20b model returns a complex object. We need to parse it to find the text. let fullAssistantResponse Sorry, the response format was unexpected.; if (result.output && Array.isArray(result.output)) { const messageOutput result.output.find(o > o.type message); if (messageOutput && messageOutput.content && messageOutput.content.length > 0) { fullAssistantResponse messageOutput.content0.text; } } const renderer new marked.Renderer(); const originalLinkRenderer renderer.link.bind(renderer); renderer.link (href, title, text) > { const html originalLinkRenderer(href, title, text); return html.replace(/^a /, a target_blank relnoopener noreferrer ); }; assistantContentElement.innerHTML marked.parse(fullAssistantResponse, { renderer, gfm: true, breaks: true }); const copyButton document.createElement(button); copyButton.className copy-ai-message; copyButton.title Copy message; copyButton.textContent Copy; assistantTurnElement.appendChild(copyButton); // Add copy buttons to code blocks // Add copy buttons to code blocks assistantContentElement.querySelectorAll(pre).forEach(pre > { const code pre.querySelector(code); if (!code) return; const container document.createElement(div); container.classList.add(code-container); const copyButton document.createElement(button); copyButton.classList.add(copy-button); copyButton.textContent Copy; copyButton.addEventListener(click, () > { navigator.clipboard.writeText(code.textContent).then(() > { copyButton.textContent Copied!; setTimeout(() > { copyButton.textContent Copy; }, 2000); }).catch(err > { console.error(Failed to copy text: , err); copyButton.textContent Error; }); }); pre.parentNode.insertBefore(container, pre); container.appendChild(pre); container.appendChild(copyButton); }); messages.push({ role: assistant, content: fullAssistantResponse }); output.scrollTop output.scrollHeight; // Auto-scroll } catch (error) { assistantContentElement.textContent Sorry, something went wrong: + error.message; } finally { toggleInput(true); } }); textarea.addEventListener(keydown, (e) > { if (e.key Enter && !e.shiftKey) { e.preventDefault(); form.dispatchEvent(new Event(submit, { cancelable: true })); } }); function addMessage(text, role) { const roleForClass role assistant ? gemini : role; const turn document.createElement(div); turn.classList.add(turn, roleForClass); const content document.createElement(div); content.textContent text; turn.appendChild(content); output.appendChild(turn); output.scrollTop output.scrollHeight; return turn; // Return the whole bubble } function toggleInput(enabled) { textarea.disabled !enabled; button.disabled !enabled; if (enabled) { textarea.focus(); button.classList.remove(loading); } else { button.classList.add(loading); } } textarea.focus(); /script>/body>/html>
Port 443
HTTP/1.1 200 OKDate: Wed, 04 Mar 2026 20:21:01 GMTContent-Type: text/htmlContent-Length: 16804Connection: keep-aliveReport-To: {group:cf-nel,max_age:604800,endpoints:{url:https://a.nel.cloudflare.com/report/v4?s8Ov5EoU75lkAcioVNIgUZTpRbnG%2BILrOC618yeFzEokiZWwdUuZ4qtWjdXfUlfw4Ry9ZctGxfzl%2FWoKbTVy6mcutHLlFJC2AWlNm2tIfV3bg0XUl7xdYFA%3D%3D}}Nel: {report_to:cf-nel,success_fraction:0.0,max_age:604800}Server: cloudflareCF-RAY: 9d7395bc48f4efac-PDXalt-svc: h3:443; ma86400 !DOCTYPE html>html langen>head> meta charsetUTF-8> meta nameviewport contentwidthdevice-width, initial-scale1.0> title>Workers AI Chat Demo/title> script srchttps://cdn.jsdelivr.net/npm/marked/marked.min.js>/script> style> :root { --md-sys-color-primary: #ffffff; --md-sys-color-on-primary: #000000; --md-sys-color-primary-container: #333333; --md-sys-color-on-primary-container: #ffffff; --md-sys-color-secondary: #D7C1D2; --md-sys-color-on-secondary: #3B2D3A; --md-sys-color-secondary-container: #524351; --md-sys-color-on-secondary-container: #F4DDEE; --md-sys-color-tertiary: #F5B8B5; --md-sys-color-on-tertiary: #4C2524; --md-sys-color-tertiary-container: #663B39; --md-sys-color-on-tertiary-container: #FFDAD8; --md-sys-color-error: #FFB4AB; --md-sys-color-on-error: #690005; --md-sys-color-background: #111316; --md-sys-color-on-background: #e2e2e6; --md-sys-color-surface: #111316; --md-sys-color-on-surface: #e2e2e6; --md-sys-color-surface-variant: #333639; --md-sys-color-on-surface-variant: #909499; --md-sys-color-outline: #5c6166; --md-sys-color-outline-variant: #5c6166; --md-sys-color-surface-container: #1d2023; --md-sys-color-surface-container-high: #333639; --md-sys-color-code-bg: #000; --md-sys-color-code-text: #e2e2e6; }* { box-sizing: border-box;}body { font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, sans-serif; margin: 0; background-color: var(--md-sys-color-background); color: var(--md-sys-color-on-background); display: flex; justify-content: center;}main { width: 100%; max-width: 800px; height: 100dvh; display: flex; flex-direction: column; padding: 1rem; position: relative;}#output { flex-grow: 1; overflow-y: auto; padding: 3.5rem 0.5rem 6rem; display: flex; flex-direction: column; gap: 1rem; scrollbar-width: none; /* Firefox */ -ms-overflow-style: none; /* IE and Edge */}#output::-webkit-scrollbar { display: none; /* Chrome, Safari, Opera */}@keyframes turn-enter { from { opacity: 0; transform: scale(0.95) translateY(10px); border-radius: 2rem; } to { opacity: 1; transform: scale(1) translateY(0); }}.turn { padding: 1rem; max-width: 90%; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 5%); line-height: 1.5; animation: turn-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);}.turn.user { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); align-self: flex-end; border-radius: 1.5rem 1.5rem 0.5rem 1.5rem;}.turn.gemini { background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); align-self: flex-start; border-radius: 1.5rem 1.5rem 1.5rem 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; position: relative;}.copy-ai-message { position: absolute; bottom: 0.5rem; right: 0.5rem; background: var(--md-sys-color-surface-variant); border: 1px solid var(--md-sys-color-outline); color: var(--md-sys-color-on-surface-variant); border-radius: 6px; padding: 4px 8px; font-size: 0.75rem; cursor: pointer; opacity: 0; transition: opacity 0.2s ease;}.turn.gemini:hover .copy-ai-message { opacity: 1;}.summary { font-size: 0.8rem; opacity: 0.7; border-left: 3px solid var(--md-sys-color-outline); padding-left: 0.75rem; font-style: italic;}#new-chat-button { position: absolute; top: 1rem; left: 1rem; z-index: 10; background: none; border: none; padding: 0.5rem; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--md-sys-color-on-surface-variant);}#new-chat-button:hover { background-color: var(--md-sys-color-surface-container-high); color: var(--md-sys-color-on-surface);}form { position: absolute; bottom: 1rem; left: 1rem; right: 1rem; display: flex; gap: 0.75rem; padding: 0.75rem; align-items: center; border-radius: 1.75rem; /* 28px */ background-color: var(--md-sys-color-surface-container); box-shadow: 0 4px 8px 3px rgba(0,0,0,0.2);}textarea { flex-grow: 1; padding: 1rem; border-radius: 1.25rem; border: 1px solid var(--md-sys-color-outline-variant); background-color: var(--md-sys-color-surface); color: var(--md-sys-color-on-surface); font-family: inherit; font-size: 1rem; resize: none; max-height: 200px; transition: border-color 0.2s ease, box-shadow 0.2s ease;}textarea:focus { outline: none; border-color: var(--md-sys-color-primary); box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);}button { padding: 1rem 1.5rem; border: none; background-color: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border-radius: 1.25rem; cursor: pointer; font-size: 1rem; font-weight: 700; transition: all 0.2s ease; position: relative; overflow: hidden; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.1), 0 1px 3px 1px rgb(0 0 0 / 0.1); display: flex; align-items: center; justify-content: center;}button:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 1px 3px 1px rgb(0 0 0 / 0.15), 0 2px 6px 2px rgb(0 0 0 / 0.15); transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;}button:disabled { background-color: var(--md-sys-color-on-surface); opacity: 0.12; color: var(--md-sys-color-on-surface); box-shadow: none; cursor: not-allowed; transform: scale(1);}.code-container { position: relative;}.copy-button { position: absolute; top: 8px; right: 8px; padding: 4px 8px; border: 1px solid var(--md-sys-color-outline); background-color: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); border-radius: 6px; font-size: 0.75rem; cursor: pointer; opacity: 0.5; transition: opacity 0.2s;}.code-container:hover .copy-button { opacity: 1;}pre { border: 1px solid var(--md-sys-color-outline); padding: 1em; overflow: auto; border-radius: 8px; background-color: var(--md-sys-color-code-bg); color: var(--md-sys-color-code-text);}.ripple { position: absolute; border-radius: 50%; transform: scale(0); animation: ripple 600ms linear; background-color: var(--md-sys-color-on-primary); opacity: 0.4;}@keyframes ripple { to { transform: scale(4); opacity: 0; }}.turn.gemini a { color: var(--md-sys-color-on-surface); text-decoration: none; padding-right: 1.2em; position: relative;}.turn.gemini a::before { content: ; position: absolute; bottom: 0; left: 0; width: calc(100% - 1.2em); border-bottom: 2px dotted currentColor;}.turn.gemini a:hover { color: var(--md-sys-color-primary);}.turn.gemini a::after { content: ↗; position: absolute; right: 0; top: 0; font-size: 0.9em; line-height: 1;}/* Loading Spinner */.button-text { transition: opacity 0.2s ease-in-out;}.spinner { position: absolute; width: 24px; height: 24px; opacity: 0; transition: opacity 0.2s ease-in-out; animation: rotate 2s linear infinite;}.spinner .path { stroke: var(--md-sys-color-on-primary); stroke-linecap: round; animation: dash 1.5s ease-in-out infinite;}button.loading .button-text { opacity: 0;}button.loading .spinner { opacity: 1;}@keyframes rotate { 100% { transform: rotate(360deg); }}@keyframes dash { 0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; } 50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; } 100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }} /style>/head>body> main> button idnew-chat-button titleNew Chat> svg xmlnshttp://www.w3.org/2000/svg width24 height24 viewBox0 0 24 24 fillnone strokecurrentColor stroke-width2 stroke-linecapround stroke-linejoinround classicon-new-chat>path dM12 5v14/>path dM5 12h14/>/svg> /button> div idoutput> div classturn gemini> div>Hello! How can I help you today?/div> button classcopy-ai-message titleCopy message>Copy/button> /div> /div> form> textarea placeholderType your message... rows1>/textarea> button typesubmit> span classbutton-text>Send/span> svg classspinner viewBox0 0 50 50> circle classpath cx25 cy25 r20 fillnone stroke-width5>/circle> /svg> /button> /form> /main> script> document.getElementById(new-chat-button).addEventListener(click, () > { window.location.reload(); }); const output document.getElementById(output); output.addEventListener(click, e > { const copyBtn e.target.closest(.copy-ai-message); if (copyBtn) { const turnElement copyBtn.closest(.turn); const content turnElement.querySelector(div:not(.summary)); navigator.clipboard.writeText(content.innerText).then(() > { copyBtn.textContent Copied!; setTimeout(() > { copyBtn.textContent Copy; }, 2000); }).catch(err > { console.error(Failed to copy: , err); }); } }); const form document.querySelector(form); const textarea form.querySelector(textarea); const button form.querySelector(button); // The entire conversation history is stored here let messages { role: system, content: You are a helpful and friendly assistant. }, { role: assistant, content: Hello! How can I help you today? I will stream my responses. } ; form.addEventListener(submit, async (e) > { e.preventDefault(); const userText textarea.value.trim(); if (!userText) return; // Add user message to UI and history addMessage(userText, user); messages.push({ role: user, content: userText }); textarea.value ; // Disable input while waiting for response toggleInput(false); // Create a placeholder for the assistants message const assistantTurnElement addMessage(, assistant); const assistantContentElement assistantTurnElement.querySelector(div); try { const response await fetch(/api/chat, { method: POST, headers: { Content-Type: application/json }, body: JSON.stringify({ messages }) }); if (!response.ok) { const errorData await response.json().catch(() > ({ error: API request failed })); throw new Error(errorData.error || API request failed); } // Handle the non-streaming JSON response const result await response.json(); // Extract and display the summary from the reasoning part of the output const reasoningOutput result.output?.find(o > o.type reasoning); if (reasoningOutput?.content?.0?.text) { const summaryText reasoningOutput.content0.text; const summaryElement document.createElement(div); summaryElement.classList.add(summary); summaryElement.textContent summaryText; assistantTurnElement.prepend(summaryElement); } // The gpt-oss-20b model returns a complex object. We need to parse it to find the text. let fullAssistantResponse Sorry, the response format was unexpected.; if (result.output && Array.isArray(result.output)) { const messageOutput result.output.find(o > o.type message); if (messageOutput && messageOutput.content && messageOutput.content.length > 0) { fullAssistantResponse messageOutput.content0.text; } } const renderer new marked.Renderer(); const originalLinkRenderer renderer.link.bind(renderer); renderer.link (href, title, text) > { const html originalLinkRenderer(href, title, text); return html.replace(/^a /, a target_blank relnoopener noreferrer ); }; assistantContentElement.innerHTML marked.parse(fullAssistantResponse, { renderer, gfm: true, breaks: true }); const copyButton document.createElement(button); copyButton.className copy-ai-message; copyButton.title Copy message; copyButton.textContent Copy; assistantTurnElement.appendChild(copyButton); // Add copy buttons to code blocks // Add copy buttons to code blocks assistantContentElement.querySelectorAll(pre).forEach(pre > { const code pre.querySelector(code); if (!code) return; const container document.createElement(div); container.classList.add(code-container); const copyButton document.createElement(button); copyButton.classList.add(copy-button); copyButton.textContent Copy; copyButton.addEventListener(click, () > { navigator.clipboard.writeText(code.textContent).then(() > { copyButton.textContent Copied!; setTimeout(() > { copyButton.textContent Copy; }, 2000); }).catch(err > { console.error(Failed to copy text: , err); copyButton.textContent Error; }); }); pre.parentNode.insertBefore(container, pre); container.appendChild(pre); container.appendChild(copyButton); }); messages.push({ role: assistant, content: fullAssistantResponse }); output.scrollTop output.scrollHeight; // Auto-scroll } catch (error) { assistantContentElement.textContent Sorry, something went wrong: + error.message; } finally { toggleInput(true); } }); textarea.addEventListener(keydown, (e) > { if (e.key Enter && !e.shiftKey) { e.preventDefault(); form.dispatchEvent(new Event(submit, { cancelable: true })); } }); function addMessage(text, role) { const roleForClass role assistant ? gemini : role; const turn document.createElement(div); turn.classList.add(turn, roleForClass); const content document.createElement(div); content.textContent text; turn.appendChild(content); output.appendChild(turn); output.scrollTop output.scrollHeight; return turn; // Return the whole bubble } function toggleInput(enabled) { textarea.disabled !enabled; button.disabled !enabled; if (enabled) { textarea.focus(); button.classList.remove(loading); } else { button.classList.add(loading); } } textarea.focus(); /script>/body>/html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]