File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ export async function handler(
136136 ...createBodyConverter ( opts . format , providerInfo . format ) ( body ) ,
137137 model : providerInfo . model ,
138138 ...( providerInfo . payloadModifier ?? { } ) ,
139+ ...Object . fromEntries (
140+ Object . entries ( providerInfo . payloadMappings ?? { } )
141+ . map ( ( [ k , v ] ) => [ k , input . request . headers . get ( v ) ] )
142+ . filter ( ( [ _k , v ] ) => ! ! v ) ,
143+ ) ,
139144 } ,
140145 authInfo ?. workspaceID ,
141146 ) ,
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export namespace ZenData {
4747 format : FormatSchema . optional ( ) ,
4848 headerMappings : z . record ( z . string ( ) , z . string ( ) ) . optional ( ) ,
4949 payloadModifier : z . record ( z . string ( ) , z . any ( ) ) . optional ( ) ,
50+ payloadMappings : z . record ( z . string ( ) , z . string ( ) ) . optional ( ) ,
5051 } )
5152
5253 const ModelsSchema = z . object ( {
You can’t perform that action at this time.
0 commit comments