@@ -11,7 +11,6 @@ import type { Logger } from '@mongodb-js/compass-logging';
1111import { EJSON } from 'bson' ;
1212import { getStore } from './store/atlas-ai-store' ;
1313import { optIntoGenAIWithModalPrompt } from './store/atlas-optin-reducer' ;
14- import { signIntoAtlasWithModalPrompt } from './store/atlas-signin-reducer' ;
1514
1615type GenerativeAiInput = {
1716 userInput : string ;
@@ -197,9 +196,11 @@ const aiURLConfig = {
197196 // There are two different sets of endpoints we use for our requests.
198197 // Down the line we'd like to only use the admin api, however,
199198 // we cannot currently call that from the Atlas UI. Pending CLOUDP-251201
199+ // NOTE: The unauthenticated endpoints are also rate limited by IP address
200+ // rather than by logged in user.
200201 'admin-api' : {
201- aggregation : 'ai/api/v1/mql-aggregation' ,
202- query : 'ai/api/v1/mql-query' ,
202+ aggregation : 'unauth/ ai/api/v1/mql-aggregation' ,
203+ query : 'unauth/ ai/api/v1/mql-query' ,
203204 } ,
204205 cloud : {
205206 aggregation : ( groupId : string ) => `ai/v1/groups/${ groupId } /mql-aggregation` ,
@@ -277,17 +278,7 @@ export class AtlasAiService {
277278 }
278279
279280 async ensureAiFeatureAccess ( { signal } : { signal ?: AbortSignal } = { } ) {
280- if ( this . preferences . getPreferences ( ) . enableUnauthenticatedGenAI ) {
281- return getStore ( ) . dispatch ( optIntoGenAIWithModalPrompt ( { signal } ) ) ;
282- }
283-
284- // When the ai feature is attempted to be opened we make sure
285- // the user is signed into Atlas and opted in.
286-
287- if ( this . apiURLPreset === 'cloud' ) {
288- return getStore ( ) . dispatch ( optIntoGenAIWithModalPrompt ( { signal } ) ) ;
289- }
290- return getStore ( ) . dispatch ( signIntoAtlasWithModalPrompt ( { signal } ) ) ;
281+ return getStore ( ) . dispatch ( optIntoGenAIWithModalPrompt ( { signal } ) ) ;
291282 }
292283
293284 private getQueryOrAggregationFromUserInput = async < T > (
0 commit comments