diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index 7454f233..b79fc99b 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -802,6 +802,8 @@ "ai_request_naming_style_camel_case": "Camel Case ( camelCase )", "ai_request_naming_style_snake_case": "Snake Case ( snake_case )", "ai_request_naming_style_pascal_case": "Pascal Case ( PascalCase )", + "ai_request_naming_style_custom": "Custom", + "ai_request_naming_style_custom_placeholder": "Enter your custom naming style template...", "sync": "Synchronise", "sync_collections": "Collections", "sync_description": "These settings are synced to cloud.", diff --git a/packages/hoppscotch-common/src/composables/ai-experiments.ts b/packages/hoppscotch-common/src/composables/ai-experiments.ts index 8739360a..767bd836 100644 --- a/packages/hoppscotch-common/src/composables/ai-experiments.ts +++ b/packages/hoppscotch-common/src/composables/ai-experiments.ts @@ -50,6 +50,7 @@ export const useRequestNameGeneration = (targetNameRef: Ref) => { } const namingStyle = useSetting("AI_REQUEST_NAMING_STYLE").value + const customNamingStyle = useSetting("CUSTOM_NAMING_STYLE").value isGenerateRequestNamePending.value = true @@ -60,7 +61,7 @@ export const useRequestNameGeneration = (targetNameRef: Ref) => { const result = await generateRequestNameForPlatform( JSON.stringify(requestContext), - namingStyle + namingStyle === "CUSTOM" ? customNamingStyle : namingStyle ) if (result && E.isLeft(result)) { diff --git a/packages/hoppscotch-common/src/newstore/settings.ts b/packages/hoppscotch-common/src/newstore/settings.ts index b0130a69..8581fbf5 100644 --- a/packages/hoppscotch-common/src/newstore/settings.ts +++ b/packages/hoppscotch-common/src/newstore/settings.ts @@ -78,6 +78,8 @@ export type SettingsDef = { | "camelCase" | "snake_case" | "PascalCase" + | "CUSTOM" + CUSTOM_NAMING_STYLE: string } export const getDefaultSettings = (): SettingsDef => ({ @@ -129,6 +131,7 @@ export const getDefaultSettings = (): SettingsDef => ({ HAS_OPENED_SPOTLIGHT: false, ENABLE_AI_EXPERIMENTS: true, AI_REQUEST_NAMING_STYLE: "DESCRIPTIVE_WITH_SPACES", + CUSTOM_NAMING_STYLE: "", }) type ApplySettingPayload = { diff --git a/packages/hoppscotch-common/src/pages/settings.vue b/packages/hoppscotch-common/src/pages/settings.vue index f2325b20..4da02218 100644 --- a/packages/hoppscotch-common/src/pages/settings.vue +++ b/packages/hoppscotch-common/src/pages/settings.vue @@ -87,53 +87,70 @@ -
- - - - - + +
+
+