MCPcopy Create free account
hub / github.com/anus-dev/ANUS / apiCall

Method apiCall

packages/core/src/core/anusChat.ts:213–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) => {

Callers

nothing calls this directly

Calls 4

getModelMethod · 0.80
getQuotaErrorOccurredMethod · 0.80
generateContentMethod · 0.65
generateContentStreamMethod · 0.65

Tested by

no test coverage detected