diff --git a/assets/arena.html b/assets/arena.html index b20553d..138849d 100644 --- a/assets/arena.html +++ b/assets/arena.html @@ -482,8 +482,8 @@ const QUERY = parseQueryString(location.search); const NUM = parseInt(QUERY.num) || 2 const API_BASE = QUERY.api_base || "."; - const DATAJSON_API = API_BASE + "/data.json"; const CHAT_COMPLETIONS_URL = API_BASE + "/v1/chat/completions"; + const MODELS_API = API_BASE + "/v1/models"; const MODEL_IDS_STORAGE_KEY = "__model_ids__"; document.addEventListener("alpine:init", () => { @@ -512,7 +512,7 @@ async init() { try { - const { models } = await fetchDataJSON(DATAJSON_API); + const models = await fetchJSON(MODELS_API); this.models = models; } catch (err) { console.error(err); @@ -755,10 +755,10 @@ })); } - async function fetchDataJSON(url) { + async function fetchJSON(url) { const res = await fetch(url); const data = await res.json() - return data; + return data.data; } async function* fetchChatCompletions(url, body, signal) { diff --git a/assets/playground.html b/assets/playground.html index 0036fb4..af675fd 100644 --- a/assets/playground.html +++ b/assets/playground.html @@ -641,8 +641,9 @@