Modifying new_prompt logging to handle real prompts only (#8788)

Co-authored-by: owenofbrien <86964623+owenofbrien@users.noreply.github.com>
This commit is contained in:
MRK
2025-09-22 14:31:06 -07:00
committed by GitHub
parent 59df649349
commit fcffcfbacb

View File

@@ -304,15 +304,6 @@ export const useGeminiStream = (
if (typeof query === 'string') {
const trimmedQuery = query.trim();
logUserPrompt(
config,
new UserPromptEvent(
trimmedQuery.length,
prompt_id,
config.getContentGeneratorConfig()?.authType,
trimmedQuery,
),
);
onDebugMessage(`User query: '${trimmedQuery}'`);
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
@@ -782,6 +773,19 @@ export const useGeminiStream = (
}
if (!options?.isContinuation) {
if (typeof queryToSend === 'string') {
// logging the text prompts only for now
const promptText = queryToSend;
logUserPrompt(
config,
new UserPromptEvent(
promptText.length,
prompt_id,
config.getContentGeneratorConfig()?.authType,
promptText,
),
);
}
startNewPrompt();
setThought(null); // Reset thought when starting a new prompt
}