diff --git a/core/config/load.ts b/core/config/load.ts index 2064dd61d..74c5c497a 100644 --- a/core/config/load.ts +++ b/core/config/load.ts @@ -134,6 +134,10 @@ function loadSerializedConfig( config.allowAnonymousTelemetry = true; } + if (config.getChatTitles === undefined) { + config.getChatTitles = true; + } + if (ideSettings.remoteConfigServerUrl) { try { const remoteConfigJson = resolveSerializedConfig( @@ -511,6 +515,7 @@ function finalToBrowserConfig( embeddingsProvider: final.embeddingsProvider?.id, ui: final.ui, experimental: final.experimental, + getChatTitles: final.getChatTitles, }; } diff --git a/core/index.d.ts b/core/index.d.ts index 8866142d8..d7c142b8a 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -978,11 +978,6 @@ interface ExperimentalConfig { */ readResponseTTS?: boolean; - /** - * Prompt the user's LLM for a title given the current chat content - */ - getChatTitles?: boolean; - /** * If set to true, we will attempt to pull down and install an instance of Chromium * that is compatible with the current version of Puppeteer. @@ -1019,6 +1014,7 @@ export interface SerializedContinueConfig { experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; + getChatTitles?: boolean; } export type ConfigMergeType = "merge" | "overwrite"; @@ -1093,6 +1089,7 @@ export interface ContinueConfig { experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; docs?: SiteIndexingConfig[]; + getChatTitles?: boolean; } export interface BrowserSerializedContinueConfig { @@ -1111,4 +1108,5 @@ export interface BrowserSerializedContinueConfig { reranker?: RerankerDescription; experimental?: ExperimentalConfig; analytics?: AnalyticsConfig; + getChatTitles?: boolean; } diff --git a/core/util/chatDescriber.ts b/core/util/chatDescriber.ts index 7a4f2d546..cafa9d692 100644 --- a/core/util/chatDescriber.ts +++ b/core/util/chatDescriber.ts @@ -40,7 +40,7 @@ export class ChatDescriber { return; } - completionOptions.maxTokens = 24; + completionOptions.maxTokens = 6; // Prompt the user's current LLM for the title const titleResponse = await model.chat( diff --git a/gui/src/hooks/useHistory.tsx b/gui/src/hooks/useHistory.tsx index ea9e0668b..e62de673b 100644 --- a/gui/src/hooks/useHistory.tsx +++ b/gui/src/hooks/useHistory.tsx @@ -54,16 +54,13 @@ function useHistory(dispatch: Dispatch) { if (state.history.length === 0) return; const stateCopy = { ...state }; - if (open_new_session){ + if (open_new_session) { dispatch(newSession()); updateLastSessionId(stateCopy.sessionId); } await new Promise((resolve) => setTimeout(resolve, 10)); - if ( - state.config?.experimental?.getChatTitles && - stateCopy.title === "New Session" - ) { + if (state.config?.getChatTitles && stateCopy.title === "New Session") { try { // Check if we have first assistant response let assistantResponse = stateCopy.history @@ -89,8 +86,8 @@ function useHistory(dispatch: Dispatch) { MAX_TITLE_LENGTH, ) : stateCopy.title?.length > 0 - ? stateCopy.title - : (await getSession(stateCopy.sessionId)).title; // to ensure titles are synced with updates from history page. + ? stateCopy.title + : (await getSession(stateCopy.sessionId)).title; // to ensure titles are synced with updates from history page. const sessionInfo: PersistedSessionInfo = { history: stateCopy.history,