diff --git a/sidebar.ts b/sidebar.ts index f367b95..38dcbc3 100644 --- a/sidebar.ts +++ b/sidebar.ts @@ -1793,8 +1793,8 @@ export async function fetchAndUpdateSidebar() { throw new Error(`Failed to fetch sidebar: ${response.statusText}`); } sidebarContent = await response.text(); - console.log('Successfully fetched and updated sidebar content'); - console.log(sidebarContent); + console.error('Successfully fetched and updated sidebar content'); + console.error(sidebarContent); } catch (error) { console.error('Error fetching sidebar:', error); // We'll keep using the fallback content if fetch fails diff --git a/tools.ts b/tools.ts index c83fa47..d400bd6 100644 --- a/tools.ts +++ b/tools.ts @@ -5,26 +5,26 @@ import { z } from "zod"; export const getGuide = async ({ guideLink, }: z.infer) => { - console.log("Received request for guide:", guideLink); + console.error("Received request for guide:", guideLink); try { // Remove the base URL prefix and ensure the path starts correctly const guidePath = guideLink.replace("https://docs.base.org", ""); const githubRawUrl = `https://raw.githubusercontent.com/base/web/refs/heads/master/apps/base-docs/docs/pages${guidePath}.mdx`; - console.log("Fetching from URL:", githubRawUrl); + console.error("Fetching from URL:", githubRawUrl); const response = await fetch(githubRawUrl); if (!response.ok) { throw new Error(`Failed to fetch guide: ${response.statusText}`); } const guide = await response.text(); - console.log("Successfully fetched guide content"); + console.error("Successfully fetched guide content"); let finalResult = guide; if (process.env.OPENAI_API_KEY) { const client = new OpenAI(); // Process the guide content with GPT-4 - console.log("Processing with ChatGPT..."); + console.error("Processing with ChatGPT..."); const result = await client.responses.create({ model: "gpt-4o-mini", input: [ @@ -37,7 +37,7 @@ export const getGuide = async ({ ], }); finalResult = result.output_text; - console.log("Successfully processed guide content"); + console.error("Successfully processed guide content"); } return {