From 4174347769fa259bd0bb72c5dbe08ef26a2177ee Mon Sep 17 00:00:00 2001 From: James Date: Wed, 23 Oct 2024 09:54:25 +0700 Subject: [PATCH] chore: update openapi reference name jan->cortex --- docs/docusaurus.config.ts | 18 +++++++++--------- docs/static/openapi/{jan.json => cortex.json} | 0 engine/CMakeLists.txt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) rename docs/static/openapi/{jan.json => cortex.json} (100%) diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 235c288ef..2595a16c5 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -20,7 +20,7 @@ const formattedDate = `${month}-${day}-${year}`; async function fetchDataDaily(date: string) { const response = await fetch( - `https://delta.jan.ai/openai-api-collection-test/${date}.json` + `https://delta.jan.ai/openai-api-collection-test/${date}.json`, ); if (!response.ok) { return {}; @@ -120,7 +120,7 @@ const config: Config = { try { let refs = {}; const response = await fetch( - `https://huggingface.co/api/models/${model.name}/refs` + `https://huggingface.co/api/models/${model.name}/refs`, ); refs = await response.json(); fetchedModels.push({ @@ -153,7 +153,7 @@ const config: Config = { path: `/models/${page.name.replace("cortexso/", "")}`, // the page component used to render the page component: require.resolve( - "./src/components/MyModelPage/index.tsx" + "./src/components/MyModelPage/index.tsx", ), // will only match for exactly matching paths exact: true, @@ -164,7 +164,7 @@ const config: Config = { // in this case, we merge the page data together with the loaded content data customData: { ...page }, }); - }) + }), ); } catch (error) { console.error("Error fetching models:", error); @@ -201,7 +201,7 @@ const config: Config = { changelog.sort( (a, b) => new Date(b.frontmatter.date).getTime() - - new Date(a.frontmatter.date).getTime() + new Date(a.frontmatter.date).getTime(), ); setGlobalData(changelog); }, @@ -214,7 +214,7 @@ const config: Config = { async contentLoaded({ content, actions }) { const { setGlobalData } = actions; const fetchRepoInfo = await fetch( - "https://api.github.com/repos/janhq/cortex.cpp" + "https://api.github.com/repos/janhq/cortex.cpp", ); const repoInfo = await fetchRepoInfo.json(); setGlobalData(repoInfo); @@ -227,7 +227,7 @@ const config: Config = { async contentLoaded({ content, actions }) { const { setGlobalData } = actions; const fetchLatestRelease = await fetch( - "https://api.github.com/repos/janhq/cortex.cpp/releases/latest" + "https://api.github.com/repos/janhq/cortex.cpp/releases/latest", ); const latestRelease = await fetchLatestRelease.json(); setGlobalData(latestRelease); @@ -240,7 +240,7 @@ const config: Config = { async contentLoaded({ content, actions }) { const { setGlobalData } = actions; const fetchTotalCoverage = await fetch( - "https://delta.jan.ai/openai-api-collection-test/total-coverage.json" + "https://delta.jan.ai/openai-api-collection-test/total-coverage.json", ); const totalCoverage = await fetchTotalCoverage.json(); setGlobalData(totalCoverage); @@ -275,7 +275,7 @@ const config: Config = { route: "/api-reference", configuration: { spec: { - url: "/openapi/jan.json", + url: "/openapi/cortex.json", }, hideModels: true, }, diff --git a/docs/static/openapi/jan.json b/docs/static/openapi/cortex.json similarity index 100% rename from docs/static/openapi/jan.json rename to docs/static/openapi/cortex.json diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index e09e43646..dadad73a9 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -81,7 +81,7 @@ find_package(SQLiteCpp REQUIRED) find_package(eventpp CONFIG REQUIRED) ## Generating openapi json -file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../docs/static/openapi/jan.json" JSON_CONTENT) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../docs/static/openapi/cortex.json" JSON_CONTENT) string(LENGTH "${JSON_CONTENT}" CONTENT_LENGTH) message("Content length: ${CONTENT_LENGTH}")