Skip to content

Commit

Permalink
Add constants for site creation parameters and refactor NL2SiteServic…
Browse files Browse the repository at this point in the history
…e to use them
  • Loading branch information
amitjoshi committed Nov 22, 2024
1 parent 66240c4 commit 255c97e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
*/

export const EDITABLE_SCHEME = 'editable';
export const ENGLISH = "English";
export const MIN_PAGES = 7;
export const MAX_PAGES = 7;
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { NL2SITE_GENERATE_NEW_SITE, NL2SITE_INVALID_RESPONSE, NL2SITE_SCENARIO}
import {VSCODE_EXTENSION_NL2SITE_REQUEST_FAILED, VSCODE_EXTENSION_NL2SITE_REQUEST_SUCCESS } from "../../PowerPagesChatParticipantTelemetryConstants";
import { getCommonHeaders } from "../../../../services/AuthenticationProvider";
import { oneDSLoggerWrapper } from "../../../../OneDSLoggerTelemetry/oneDSLoggerWrapper";
import { ENGLISH, MAX_PAGES, MIN_PAGES } from "./CreateSiteConstants";

export async function getNL2SiteData(aibEndpoint: string, aibToken: string, userPrompt: string, sessionId: string, telemetry: ITelemetry, orgId: string, envId: string, userId: string) {
const requestBody = {
Expand All @@ -22,9 +23,9 @@ export async function getNL2SiteData(aibEndpoint: string, aibToken: string, user
// "shouldCheckBlockList": false, //TODO: Check if this is needed
"version": "V1",
"information": {
"minPages": 7,
"maxPages": 7,
"language": "English"
"minPages": MIN_PAGES,
"maxPages": MAX_PAGES,
"language": ENGLISH

}
}
Expand Down

0 comments on commit 255c97e

Please sign in to comment.