Skip to content

Commit

Permalink
chore: add query to ai assistant context logging (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhong84 committed Sep 28, 2023
1 parent bac499c commit 9c322ae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions querybook/webapp/components/AIAssistant/QueryGenerationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ export const QueryGenerationModal = ({
<Button
title="Cancel"
onClick={() => {
if (newQuery) {
trackClick({
component: ComponentType.AI_ASSISTANT,
element: ElementType.QUERY_GENERATION_REJECT_BUTTON,
aux: {
mode: textToSQLMode,
question,
tables,
query: newQuery,
},
});
}
onHide();
}}
/>
Expand All @@ -255,6 +267,7 @@ export const QueryGenerationModal = ({
mode: textToSQLMode,
question,
tables,
query: newQuery,
},
});
onHide();
Expand All @@ -273,6 +286,7 @@ export const QueryGenerationModal = ({
mode: textToSQLMode,
question,
tables,
query: newQuery,
},
});
onHide();
Expand Down Expand Up @@ -367,6 +381,7 @@ export const QueryGenerationModal = ({
mode: textToSQLMode,
question,
tables,
query: newQuery,
},
});
}}
Expand Down
1 change: 1 addition & 0 deletions querybook/webapp/const/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export enum ElementType {
QUERY_ERROR_AUTO_FIX_APPLY_AND_RUN_BUTTON = 'QUERY_ERROR_AUTO_FIX_APPLY_AND_RUN_BUTTON',
QUERY_GENERATION_BUTTON = 'QUERY_GENERATION_BUTTON',
QUERY_GENERATION_KEEP_BUTTON = 'QUERY_GENERATION_KEEP_BUTTON',
QUERY_GENERATION_REJECT_BUTTON = 'QUERY_GENERATION_REJECT_BUTTON',
QUERY_GENERATION_APPLY_BUTTON = 'QUERY_GENERATION_APPLY_BUTTON',
QUERY_GENERATION_APPLY_AND_RUN_BUTTON = 'QUERY_GENERATION_APPLY_AND_RUN_BUTTON',
}
Expand Down

0 comments on commit 9c322ae

Please sign in to comment.