@@ -11,7 +11,6 @@ import type { Logger } from '@mongodb-js/compass-logging';
11
11
import { EJSON } from 'bson' ;
12
12
import { getStore } from './store/atlas-ai-store' ;
13
13
import { optIntoGenAIWithModalPrompt } from './store/atlas-optin-reducer' ;
14
- import { signIntoAtlasWithModalPrompt } from './store/atlas-signin-reducer' ;
15
14
16
15
type GenerativeAiInput = {
17
16
userInput : string ;
@@ -197,9 +196,11 @@ const aiURLConfig = {
197
196
// There are two different sets of endpoints we use for our requests.
198
197
// Down the line we'd like to only use the admin api, however,
199
198
// 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.
200
201
'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' ,
203
204
} ,
204
205
cloud : {
205
206
aggregation : ( groupId : string ) => `ai/v1/groups/${ groupId } /mql-aggregation` ,
@@ -277,17 +278,7 @@ export class AtlasAiService {
277
278
}
278
279
279
280
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 } ) ) ;
291
282
}
292
283
293
284
private getQueryOrAggregationFromUserInput = async < T > (
0 commit comments