MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / checkModel

Method checkModel

lib/ai.js:100–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98 }
99
100 checkModel() {
101 if (!this.isEnabled) {
102 debug('AI assistant is disabled')
103 return
104 }
105
106 if (this.config.model) return
107
108 const noModelErrorMessage = `
109 No model is set for AI assistant.
110
111 [!] Please configure AI model using Vercel AI SDK providers.
112
113 Example (connect to OpenAI):
114
115 import { openai } from '@ai-sdk/openai';
116
117 ai: {
118 model: openai('gpt-4o-mini')
119 }
120
121 Example (connect to Anthropic):
122
123 import { anthropic } from '@ai-sdk/anthropic';
124
125 ai: {
126 model: anthropic('claude-3-5-sonnet-20241022')
127 }
128
129 See https://ai-sdk.dev/docs/foundations/providers-and-models for all providers.
130 `.trim()
131
132 throw new Error(noModelErrorMessage)
133 }
134
135 async setHtmlContext(html) {
136 let processedHTML = html

Callers 1

createCompletionMethod · 0.95

Calls 1

debugFunction · 0.85

Tested by

no test coverage detected