Files
supabase/apps/studio/lib/constants/telemetry.ts
T
Joshen LimandSaxon Fletcher 12d92aed99 Assistant V2 (#30523)
* start

* added panels

* remove stuff

* fixes and refinements

* clean up

* remove old assistant panel

* resizable assistant kinda

* use icon

* Add missing package

* remove canvas

* add suggestions

* updated empty state if no tables exist

* fix table condition

* Implement diffing if using assistant in sql editor

* Reinstate old assistant in SQL editor if feature preview is off

* pane size adjustment

* assistant button corners

* Add SQL snippet content to assistant if opening assistant in sql editor

* Add the necessary checks for opt in and hipaa

* revert adding snippet to assistant when opening assistant in sql editor

* Add cmd i shortcut

* Add admonitions for when disablePrompt is toggled on, and if no api key is set. Add footer note RE rate limitation

* Bump ai package in packages

* some fixes for backwards compability depending on feature preview toggled

* Rename feature preview property for new assistant

* Smol fix

* Prevent SQL snippet from running until message is finished

* only loading last message

* fix z-index

* save chat state to global state

* add debug to failed ai queries

* Add basic contextual invalidation

* Add explain code action to SQL editor

* Add link to abort ongoing queries from SqlSnippet

* Update feature preview content

* Fix

* Fix

* Fix

* Te4st

* Fix tests

* ONly show ai button within a project

* Fix PH tracking

* Beef up a bit more event tracking

* Rough fix to padding when assistant is open

* A bit more telemetry stuff

* Update prompts

* fix rls editing via assistant

* Update generate-v3.ts

prompt to get auth schema too

* Add policy satement to assistant when editing

* Address all comments

* fixc

* Fix SqlSnippet not taking full width on larger viewports

* Adjust max width

---------

Co-authored-by: Saxon Fletcher <saxonafletcher@gmail.com>
2024-11-25 18:50:56 +08:00

39 lines
1.7 KiB
TypeScript

// [Joshen] Just adding these to start consolidating our telemetry configs
// may change depending on how we choose to standardize across all apps
// Events define the name of the event and it'll be used as the primary identification
export enum TELEMETRY_EVENTS {
FEATURE_PREVIEWS = 'Dashboard UI Feature Previews',
AI_ASSISTANT_V2 = 'AI Assistant V2',
}
// [Joshen] Values refer to the "action" of the "event"
// e.g prompt submitted (action) through the AI assistant (event)
// e.g enabled feature x (action) via the feature preview (event)
export enum TELEMETRY_VALUES {
/**
* Track whenever a prompt is submitted to the AI (excluding debug prompts)
* @context AI Assistant V2
* @purpose Indication of engagement with the feature, aid in prioritizing efforts into the assistant itself
*/
PROMPT_SUBMITTED = 'prompt-submitted',
/**
* Track whenever a debug prompt is submitted to the AI
* @context AI Assistant V2
* @purpose TBD
*/
DEBUG_SUBMITTED = 'debug-submitted',
/**
* Track running a SQL suggestion from AI Assistant
* @context AI Assistant V2
* @purpose Indication of usefulness of AI assistant response, aid in prioritizing tweak of Assistant prompts to adjust output quality
* @details Broken down into "select" or "mutation", and for the latter further broken down to the type of query (e.g "functions" or "rls-policies", default to unknown otherwise)
* */
RAN_SQL_SUGGESTION = 'ran-sql-suggestion',
/**
* Track editing a SQL suggestion:
* @context AI Assistant V2
* @purpose Indication of interest for wanting to expand from a SQL suggestion, aid in deciding the priority for an inline editor
* */
EDIT_IN_SQL_EDITOR = 'edit-in-sql-editor',
}