Skip to content

Commit cc44fa5

Browse files
DavertMikclaude
andcommitted
revert: restore generatePageObject in AiAssistant
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent fd61093 commit cc44fa5

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎lib/ai.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,22 @@ class AiAssistant {
201201
return this.config.response(response)
202202
}
203203

204+
/**
205+
*
206+
* @param {*} extraPrompt
207+
* @param {*} locator
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+
204220
stopWhenReachingTokensLimit() {
205221
if (this.numTokens < this.config.maxTokens) return
206222

0 commit comments

Comments
 (0)