Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 35 additions & 19 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,40 @@ declare namespace CodeceptJS {
Scenario: number;
};

type AiPrompt = {
role: string;
content: string;
}

type AiConfig = {
/** request function to send prompts to AI provider */
request: () => Promise<string>,

/** custom prompts */
prompts?: {
writeStep?: (string, string) => Array<AiPrompt>;
healStep?: (string, object) => Array<AiPrompt>;
},

/** max tokens to use */
maxTokens?: number,


/** configuration for processing HTML for GPT */
html?: {
/** max size of HTML to be sent to OpenAI to avoid token limit */
maxLength?: number,
/** should HTML be changed by removing non-interactive elements */
simplify?: boolean,
/** should HTML be minified before sending */
minify?: boolean,
interactiveElements?: Array<string>,
textElements?: Array<string>,
allowedAttrs?: Array<string>,
allowedRoles?: Array<string>,
}
}

type MainConfig = {
/** Pattern to locate CodeceptJS tests.
* Allows to enter glob pattern or an Array<string> of patterns to match tests / test file names.
Expand Down Expand Up @@ -353,25 +387,7 @@ declare namespace CodeceptJS {
/**
* [AI](https://codecept.io/ai/) features configuration.
*/
ai?: {
/** OpenAI model to use */
model?: string,
/** temperature, measure of randomness. Lower is better. */
temperature?: number,
/** configuration for processing HTML for GPT */
html?: {
/** max size of HTML to be sent to OpenAI to avoid token limit */
maxLength?: number,
/** should HTML be changed by removing non-interactive elements */
simplify?: boolean,
/** should HTML be minified before sending */
minify?: boolean,
interactiveElements?: Array<string>,
textElements?: Array<string>,
allowedAttrs?: Array<string>,
allowedRoles?: Array<string>,
}
},
ai?: AiConfig,

/**
* Enable full promise-based helper methods for [TypeScript](https://codecept.io/typescript/) project.
Expand Down