@@ -14,7 +14,7 @@ import { AWSError } from 'aws-sdk'
1414import { isAwsError } from '../../shared/errors'
1515import { TelemetryHelper } from '../util/telemetryHelper'
1616import { getLogger } from '../../shared/logger'
17- import { isCloud9 , isSageMaker } from '../../shared/extensionUtilities'
17+ import { isCloud9 } from '../../shared/extensionUtilities'
1818import { hasVendedIamCredentials } from '../../auth/auth'
1919import {
2020 asyncCallWithTimeout ,
@@ -157,9 +157,7 @@ export class RecommendationHandler {
157157 config : ConfigurationEntry ,
158158 autoTriggerType ?: CodewhispererAutomatedTriggerType ,
159159 pagination : boolean = true ,
160- page : number = 0 ,
161- isSM : boolean = isSageMaker ( ) ,
162- retry : boolean = false
160+ page : number = 0
163161 ) : Promise < GetRecommendationsResponse > {
164162 let invocationResult : 'Succeeded' | 'Failed' = 'Failed'
165163 let errorMessage : string | undefined = undefined
@@ -186,7 +184,7 @@ export class RecommendationHandler {
186184 ) . language
187185 session . taskType = await this . getTaskTypeFromEditorFileName ( editor . document . fileName )
188186
189- if ( pagination && ! isSM ) {
187+ if ( pagination ) {
190188 if ( page === 0 ) {
191189 session . requestContext = await EditorContext . buildListRecommendationRequest (
192190 editor as vscode . TextEditor ,
@@ -240,8 +238,9 @@ export class RecommendationHandler {
240238 startTime = performance . now ( )
241239 this . lastInvocationTime = startTime
242240 const mappedReq = runtimeLanguageContext . mapToRuntimeLanguage ( request )
243- const codewhispererPromise =
244- pagination && ! isSM ? client . listRecommendations ( mappedReq ) : client . generateRecommendations ( mappedReq )
241+ const codewhispererPromise = pagination
242+ ? client . listRecommendations ( mappedReq )
243+ : client . generateRecommendations ( mappedReq )
245244 const resp = await this . getServerResponse ( triggerType , config . isManualTriggerEnabled , codewhispererPromise )
246245 TelemetryHelper . instance . setSdkApiCallEndTime ( )
247246 latency = startTime !== 0 ? performance . now ( ) - startTime : 0
@@ -333,8 +332,7 @@ export class RecommendationHandler {
333332 config ,
334333 autoTriggerType ,
335334 pagination ,
336- page ,
337- true
335+ page
338336 )
339337 }
340338 }
0 commit comments