diff --git a/src/LLMProviders/brevilabsClient.ts b/src/LLMProviders/brevilabsClient.ts index e7baab2d..8fd85166 100644 --- a/src/LLMProviders/brevilabsClient.ts +++ b/src/LLMProviders/brevilabsClient.ts @@ -1,7 +1,9 @@ import { BREVILABS_API_BASE_URL } from "@/constants"; -import { Notice } from "obsidian"; -import { getSettings } from "@/settings/model"; import { getDecryptedKey } from "@/encryptionService"; +import { getSettings } from "@/settings/model"; +import { safeFetch } from "@/utils"; +import { Notice } from "obsidian"; + export interface BrocaResponse { response: { tool_calls: Array<{ @@ -88,7 +90,7 @@ export class BrevilabsClient { }); } - const response = await fetch(url.toString(), { + const response = await safeFetch(url.toString(), { method, headers: { "Content-Type": "application/json", diff --git a/src/LLMProviders/chainRunner.ts b/src/LLMProviders/chainRunner.ts index 767364cb..5af5675a 100644 --- a/src/LLMProviders/chainRunner.ts +++ b/src/LLMProviders/chainRunner.ts @@ -302,6 +302,11 @@ class CopilotPlusChainRunner extends BaseChainRunner { content, }); + // Add debug logging for final request + if (debug) { + console.log("==== Final Request to AI ====\n", messages); + } + let fullAIResponse = ""; const chatStream = await this.chainManager.chatModelManager.getChatModel().stream(messages); @@ -427,7 +432,7 @@ class CopilotPlusChainRunner extends BaseChainRunner { const qaPrompt = await this.chainManager.promptManager.getQAPrompt({ question: standaloneQuestion, context: context, - systemMessage: getSystemPrompt(), + systemMessage: "", // System prompt is added separately in streamMultimodalResponse }); fullAIResponse = await this.streamMultimodalResponse( diff --git a/src/LLMProviders/intentAnalyzer.ts b/src/LLMProviders/intentAnalyzer.ts index 6bac50b8..8a07efe7 100644 --- a/src/LLMProviders/intentAnalyzer.ts +++ b/src/LLMProviders/intentAnalyzer.ts @@ -30,6 +30,7 @@ export class IntentAnalyzer { indexTool, pomodoroTool, webSearchTool, + simpleYoutubeTranscriptionTool, ]; static async analyzeIntent( diff --git a/src/main.ts b/src/main.ts index a69c22bf..d3e91499 100644 --- a/src/main.ts +++ b/src/main.ts @@ -99,7 +99,7 @@ export default class CopilotPlugin extends Plugin { }, }); - this.addRibbonIcon("message-square", "Copilot Chat", (evt: MouseEvent) => { + this.addRibbonIcon("message-square", "Open Copilot Chat", (evt: MouseEvent) => { this.activateView(); }); diff --git a/src/search/hybridRetriever.ts b/src/search/hybridRetriever.ts index c9281708..a820a589 100644 --- a/src/search/hybridRetriever.ts +++ b/src/search/hybridRetriever.ts @@ -246,6 +246,14 @@ export class HybridRetriever extends BaseRetriever { const dateRange = this.generateDateRange(startDate, endDate); + if (this.debug) { + console.log( + "==== Daily note date range: ====", + dateRange[0], + dateRange[dateRange.length - 1] + ); + } + // Perform the first search with title filter const dailyNoteResults = await this.getExplicitChunks(dateRange); @@ -258,6 +266,10 @@ export class HybridRetriever extends BaseRetriever { }, })); + if (this.debug) { + console.log("==== Modified and created time range: ====", startTimestamp, endTimestamp); + } + // Perform a second search with time range filters searchParams.where = { ctime: { between: [startTimestamp, endTimestamp] },