File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
packages/compass-generative-ai/src Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -239,13 +239,6 @@ export class AtlasAiService {
239239 connectionInfo ?: ConnectionInfo
240240 ) {
241241 if ( this . apiURLPreset === 'cloud' ) {
242- const atlasMetadata = connectionInfo ?. atlasMetadata ;
243- if ( ! atlasMetadata ) {
244- throw new Error (
245- "Can't perform generative ai request: atlasMetadata is not available"
246- ) ;
247- }
248-
249242 if ( urlId === 'user-access' ) {
250243 return this . atlasService . cloudEndpoint (
251244 aiURLConfig [ this . apiURLPreset ] [ urlId ] (
@@ -254,6 +247,13 @@ export class AtlasAiService {
254247 ) ;
255248 }
256249
250+ const atlasMetadata = connectionInfo ?. atlasMetadata ;
251+ if ( ! atlasMetadata ) {
252+ throw new Error (
253+ "Can't perform generative ai request: atlasMetadata is not available"
254+ ) ;
255+ }
256+
257257 return this . atlasService . cloudEndpoint (
258258 aiURLConfig [ this . apiURLPreset ] [ urlId ] ( atlasMetadata . projectId )
259259 ) ;
@@ -264,9 +264,7 @@ export class AtlasAiService {
264264 ? urlConfig ( this . preferences . getPreferencesUser ( ) . id )
265265 : urlConfig ;
266266
267- return this . apiURLPreset === 'admin-api'
268- ? this . atlasService . adminApiEndpoint ( urlPath )
269- : this . atlasService . cloudEndpoint ( urlPath ) ;
267+ return this . atlasService . adminApiEndpoint ( urlPath ) ;
270268 }
271269
272270 private throwIfAINotEnabled ( ) {
You can’t perform that action at this time.
0 commit comments