(model: ModelV2.Info, route: AnyRoute)
| 88 | } |
| 89 | |
| 90 | const withDefaults = (model: ModelV2.Info, route: AnyRoute) => { |
| 91 | const body = model.request.body |
| 92 | const httpBody = Object.hasOwn(body, "apiKey") |
| 93 | ? Object.fromEntries(Object.entries(body).filter(([key]) => key !== "apiKey")) |
| 94 | : body |
| 95 | return route.with({ |
| 96 | provider: model.providerID, |
| 97 | endpoint: model.api.url === undefined ? undefined : { baseURL: model.api.url }, |
| 98 | headers: model.request.headers, |
| 99 | http: { body: httpBody }, |
| 100 | limits: { context: model.limit.context, output: model.limit.output }, |
| 101 | }) |
| 102 | } |
| 103 | |
| 104 | const withVariant = ( |
| 105 | model: ModelV2.Info, |
no test coverage detected