Skip to content

Commit df8464f

Browse files
committed
zen: handle cache key
1 parent 3ea387f commit df8464f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/console/app/src/routes/zen/util/handler.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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
),

packages/console/core/src/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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({

0 commit comments

Comments
 (0)