Back
Version 0
11/22/2024
/** @jsxImportSource https://esm.sh/react */
import React, { useState, useEffect, useRef } from "https://esm.sh/react";
import { createRoot } from "https://esm.sh/react-dom/client";
const CHAT_URL = "https://duckduckgo.com/duckchat/v1/chat";
const STATUS_URL = "https://duckduckgo.com/duckchat/v1/status";
const MODELS = [
"claude-3-haiku",
"gpt-4o-mini",
"llama-3.1-70b",
"mixtral-8x7b"
];
const MODEL_MAP = {
"claude-3-haiku": "claude-3-haiku-20240307",
"gpt-4o-mini": "gpt-4o-mini",
"llama-3.1-70b": "meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
"mixtral-8x7b": "mistralai/Mixtral-8x7B-Instruct-v0.1"
};
function App() {
const [messages, setMessages] = useState([]);
const [input, setInput] = useState('');
const [model, setModel] = useState(MODELS[0]);
const [vqd, setVqd] = useState('');
const [isLoading, setIsLoading] = useState(false);
const messagesEndRef = useRef(null);
const scrollToBottom = () => {
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
};
useEffect(scrollToBottom, [messages]);
kauri-ddg_chat.web.val.run
Updated: November 22, 2024