* * @param {*} extraPrompt * @param {*} locator * @returns
(extraPrompt = null, locator = null)
| 208 | * @returns |
| 209 | */ |
| 210 | async generatePageObject(extraPrompt = null, locator = null) { |
| 211 | if (!this.isEnabled) return [] |
| 212 | if (!this.minifiedHtml) throw new Error('No HTML context provided') |
| 213 | |
| 214 | const response = await this.createCompletion(this.prompts.generatePageObject(this.minifiedHtml, locator, extraPrompt)) |
| 215 | if (!response) return [] |
| 216 | |
| 217 | return this.config.response(response) |
| 218 | } |
| 219 | |
| 220 | stopWhenReachingTokensLimit() { |
| 221 | if (this.numTokens < this.config.maxTokens) return |
nothing calls this directly
no test coverage detected