Skip to content

Commit 5f4645c

Browse files
committed
Don't require Atlas login, use the unauthenticated NLQ endpoints.
1 parent 3b79fd9 commit 5f4645c

File tree

3 files changed

+5
-35
lines changed

3 files changed

+5
-35
lines changed

packages/compass-generative-ai/src/atlas-ai-service.spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -323,20 +323,6 @@ describe('AtlasAiService', function () {
323323
});
324324

325325
describe('optIntoGenAIFeatures', function () {
326-
beforeEach(async function () {
327-
// Reset preferences
328-
await preferences.savePreferences({
329-
optInGenAIFeatures: false,
330-
enableUnauthenticatedGenAI: true,
331-
});
332-
});
333-
334-
afterEach(async function () {
335-
await preferences.savePreferences({
336-
enableUnauthenticatedGenAI: false,
337-
});
338-
});
339-
340326
it('should save preference when cloud preset', async function () {
341327
const fetchStub = sandbox.stub().resolves(makeResponse({}));
342328
global.fetch = fetchStub;

packages/compass-generative-ai/src/atlas-ai-service.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,11 @@ const aiURLConfig = {
197197
// There are two different sets of endpoints we use for our requests.
198198
// Down the line we'd like to only use the admin api, however,
199199
// we cannot currently call that from the Atlas UI. Pending CLOUDP-251201
200+
// NOTE: The unauthenticated endpoints are also rate limited by IP address
201+
// rather than by logged in user.
200202
'admin-api': {
201-
aggregation: 'ai/api/v1/mql-aggregation',
202-
query: 'ai/api/v1/mql-query',
203+
aggregation: 'unauth/ai/api/v1/mql-aggregation',
204+
query: 'unauth/ai/api/v1/mql-query',
203205
},
204206
cloud: {
205207
aggregation: (groupId: string) => `ai/v1/groups/${groupId}/mql-aggregation`,
@@ -277,17 +279,7 @@ export class AtlasAiService {
277279
}
278280

279281
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 }));
282+
return getStore().dispatch(optIntoGenAIWithModalPrompt({ signal }));
291283
}
292284

293285
private getQueryOrAggregationFromUserInput = async <T>(

packages/compass-preferences-model/src/feature-flags.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export type FeatureFlags = {
2828
showIndexesGuidanceVariant: boolean;
2929
enableContextMenus: boolean;
3030
enableSearchActivationProgramP1: boolean;
31-
enableUnauthenticatedGenAI: boolean;
3231
};
3332

3433
export const featureFlags: Required<{
@@ -151,13 +150,6 @@ export const featureFlags: Required<{
151150
},
152151
},
153152

154-
enableUnauthenticatedGenAI: {
155-
stage: 'development',
156-
description: {
157-
short: 'Enable GenAI for unauthenticated users',
158-
},
159-
},
160-
161153
/**
162154
* Feature flag for CLOUDP-308952.
163155
*/

0 commit comments

Comments
 (0)