Skip to content

Commit 405616e

Browse files
authored
Merge branch 'main' into bug/stream-transform-unhandled-rejection-resource-cleanup
2 parents 214452e + b8d0ba5 commit 405616e

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/providers/bedrock/embed.ts

Lines changed: 6 additions & 4 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
};
@@ -115,9 +116,10 @@ export const BedrockTitanEmbedConfig: ProviderConfig = {
115116
encoding_format: {
116117
param: 'embeddingTypes',
117118
required: false,
118-
transform: (params: any): string[] => {
119+
transform: (params: any): string[] | undefined => {
119120
if (Array.isArray(params.encoding_format)) return params.encoding_format;
120-
return [params.encoding_format];
121+
else if (typeof params.encoding_format === 'string')
122+
return [params.encoding_format];
121123
},
122124
},
123125
// Titan specific parameters

src/providers/cohere/embed.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ export const CohereEmbedConfig: ProviderConfig = {
5050
encoding_format: {
5151
param: 'embedding_types',
5252
required: false,
53-
transform: (params: any): string[] => {
53+
transform: (params: any): string[] | undefined => {
5454
if (Array.isArray(params.encoding_format)) return params.encoding_format;
55-
return [params.encoding_format];
55+
else if (typeof params.encoding_format === 'string')
56+
return [params.encoding_format];
5657
},
5758
},
5859
//backwards compatibility

src/providers/open-ai-base/createModelResponse.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ export const OpenAICreateModelResponseConfig: ProviderConfig = {
6262
param: 'metadata',
6363
required: false,
6464
},
65-
parallel_tool_calls: {
65+
modalities: {
6666
param: 'modalities',
6767
required: false,
6868
},
69+
parallel_tool_calls: {
70+
param: 'parallel_tool_calls',
71+
required: false,
72+
},
6973
previous_response_id: {
7074
param: 'previous_response_id',
7175
required: false,

0 commit comments

Comments
 (0)