@@ -41,9 +41,6 @@ const modelIds: ModelConfiguration[] = (
4141 . map ( ( model ) => ( {
4242 modelId : model . modelId . trim ( ) ,
4343 region : model . region . trim ( ) ,
44- ...( model . inferenceProfileArn && {
45- inferenceProfileArn : model . inferenceProfileArn ,
46- } ) ,
4744 } ) )
4845 . filter ( ( model ) => model . modelId ) ;
4946// If there is a lightweight model among the available models, prioritize the lightweight model.
@@ -55,9 +52,6 @@ export const defaultModel: Model = {
5552 type : 'bedrock' ,
5653 modelId : defaultModelConfiguration . modelId ,
5754 region : defaultModelConfiguration . region ,
58- ...( defaultModelConfiguration . inferenceProfileArn && {
59- inferenceProfileArn : defaultModelConfiguration . inferenceProfileArn ,
60- } ) ,
6155} ;
6256
6357const imageGenerationModels : ModelConfiguration [ ] = (
@@ -69,19 +63,13 @@ const imageGenerationModels: ModelConfiguration[] = (
6963 ( model : ModelConfiguration ) : ModelConfiguration => ( {
7064 modelId : model . modelId . trim ( ) ,
7165 region : model . region . trim ( ) ,
72- ...( model . inferenceProfileArn && {
73- inferenceProfileArn : model . inferenceProfileArn ,
74- } ) ,
7566 } )
7667 )
7768 . filter ( ( model ) => model . modelId ) ;
7869export const defaultImageGenerationModel : Model = {
7970 type : 'bedrock' ,
8071 modelId : imageGenerationModels ?. [ 0 ] ?. modelId ?? '' ,
8172 region : imageGenerationModels ?. [ 0 ] ?. region ?? '' ,
82- ...( imageGenerationModels ?. [ 0 ] ?. inferenceProfileArn && {
83- inferenceProfileArn : imageGenerationModels [ 0 ] . inferenceProfileArn ,
84- } ) ,
8573} ;
8674
8775const videoGenerationModels : ModelConfiguration [ ] = (
@@ -93,19 +81,13 @@ const videoGenerationModels: ModelConfiguration[] = (
9381 ( model : ModelConfiguration ) : ModelConfiguration => ( {
9482 modelId : model . modelId . trim ( ) ,
9583 region : model . region . trim ( ) ,
96- ...( model . inferenceProfileArn && {
97- inferenceProfileArn : model . inferenceProfileArn ,
98- } ) ,
9984 } )
10085 )
10186 . filter ( ( model ) => model . modelId ) ;
10287export const defaultVideoGenerationModel : Model = {
10388 type : 'bedrock' ,
10489 modelId : videoGenerationModels ?. [ 0 ] ?. modelId ?? '' ,
10590 region : videoGenerationModels ?. [ 0 ] ?. region ?? '' ,
106- ...( videoGenerationModels ?. [ 0 ] ?. inferenceProfileArn && {
107- inferenceProfileArn : videoGenerationModels [ 0 ] . inferenceProfileArn ,
108- } ) ,
10991} ;
11092
11193// Model Params
@@ -420,27 +402,6 @@ const mergeConverseInferenceParams = (
420402 } ,
421403 } ) as ConverseInferenceParams ;
422404
423- // Get inference profile ARN from modelId
424- export const getInferenceProfileArn = ( modelId : string ) : string | undefined => {
425- const textModelConfig = modelIds . find ( ( config ) => config . modelId === modelId ) ;
426- if ( textModelConfig ?. inferenceProfileArn ) {
427- return textModelConfig . inferenceProfileArn ;
428- }
429- const imageModelConfig = imageGenerationModels . find (
430- ( config ) => config . modelId === modelId
431- ) ;
432- if ( imageModelConfig ?. inferenceProfileArn ) {
433- return imageModelConfig . inferenceProfileArn ;
434- }
435- const videoModelConfig = videoGenerationModels . find (
436- ( config ) => config . modelId === modelId
437- ) ;
438- if ( videoModelConfig ?. inferenceProfileArn ) {
439- return videoModelConfig . inferenceProfileArn ;
440- }
441- return undefined ;
442- } ;
443-
444405// API call, extract string from output, etc.
445406
446407const createConverseCommandInput = (
@@ -539,9 +500,8 @@ const createConverseCommandInput = (
539500
540501 const guardrailConfig = createGuardrailConfig ( ) ;
541502
542- const modelIdOrArn = getInferenceProfileArn ( model . modelId ) || model . modelId ;
543503 const converseCommandInput : ConverseCommandInput = {
544- modelId : modelIdOrArn ,
504+ modelId : model . modelId ,
545505 messages : conversationWithCache ,
546506 system : systemContextWithCache ,
547507 inferenceConfig : params . inferenceConfig ,
0 commit comments