Skip to content

Commit fcffcfb

Browse files
Modifying new_prompt logging to handle real prompts only (#8788)
Co-authored-by: owenofbrien <86964623+owenofbrien@users.noreply.github.com>
1 parent 59df649 commit fcffcfb

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

packages/cli/src/ui/hooks/useGeminiStream.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,6 @@ export const useGeminiStream = (
304304

305305
if (typeof query === 'string') {
306306
const trimmedQuery = query.trim();
307-
logUserPrompt(
308-
config,
309-
new UserPromptEvent(
310-
trimmedQuery.length,
311-
prompt_id,
312-
config.getContentGeneratorConfig()?.authType,
313-
trimmedQuery,
314-
),
315-
);
316307
onDebugMessage(`User query: '${trimmedQuery}'`);
317308
await logger?.logMessage(MessageSenderType.USER, trimmedQuery);
318309

@@ -782,6 +773,19 @@ export const useGeminiStream = (
782773
}
783774

784775
if (!options?.isContinuation) {
776+
if (typeof queryToSend === 'string') {
777+
// logging the text prompts only for now
778+
const promptText = queryToSend;
779+
logUserPrompt(
780+
config,
781+
new UserPromptEvent(
782+
promptText.length,
783+
prompt_id,
784+
config.getContentGeneratorConfig()?.authType,
785+
promptText,
786+
),
787+
);
788+
}
785789
startNewPrompt();
786790
setThought(null); // Reset thought when starting a new prompt
787791
}

0 commit comments

Comments
 (0)