()
| 211 | |
| 212 | try { |
| 213 | const apiCall = () => { |
| 214 | const modelToUse = this.config.getModel() || DEFAULT_FALLBACK_MODEL; |
| 215 | |
| 216 | // Prevent Flash model calls immediately after quota error |
| 217 | if ( |
| 218 | this.config.getQuotaErrorOccurred() && |
| 219 | modelToUse === DEFAULT_FALLBACK_MODEL |
| 220 | ) { |
| 221 | throw new Error( |
| 222 | 'Please submit a new query to continue with the Flash model.', |
| 223 | ); |
| 224 | } |
| 225 | |
| 226 | return this.contentGenerator.generateContent( |
| 227 | { |
| 228 | model: modelToUse, |
| 229 | contents: requestContents, |
| 230 | config: { ...this.generationConfig, ...params.config }, |
| 231 | }, |
| 232 | prompt_id, |
| 233 | ); |
| 234 | }; |
| 235 | |
| 236 | response = await retryWithBackoff(apiCall, { |
| 237 | shouldRetry: (error: unknown) => { |
nothing calls this directly
no test coverage detected