(modelParams: ModelParams, pipe: Pipe)
| 19 | } |
| 20 | |
| 21 | export function applyJsonModeIfEnabled(modelParams: ModelParams, pipe: Pipe) { |
| 22 | const hasJsonMode = isJsonModeOn({ |
| 23 | currentModel: modelParams.model as string, |
| 24 | jsonMode: pipe.json || false |
| 25 | }); |
| 26 | |
| 27 | if (hasJsonMode) { |
| 28 | modelParams.response_format = { type: 'json_object' }; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | export function applyJsonModeIfEnabledForGoogle( |
| 33 | transformedRequestParams: any, |
no test coverage detected