Skip to content

Commit d090667

Browse files
committed
handle null in encoding format
1 parent a3f0ac0 commit d090667

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/providers/bedrock/embed.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ export const BedrockCohereEmbedConfig: ProviderConfig = {
5252
encoding_format: {
5353
param: 'embedding_types',
5454
required: false,
55-
transform: (params: any): string[] => {
55+
transform: (params: any): string[] | undefined => {
5656
if (Array.isArray(params.encoding_format)) return params.encoding_format;
57-
return [params.encoding_format];
57+
else if (typeof params.encoding_format === 'string')
58+
return [params.encoding_format];
5859
},
5960
},
6061
};

0 commit comments

Comments
 (0)