( models: BaseLLM[], config: Config, roles: ModelRole[] | undefined = undefined, )
| 208 | |
| 209 | // Merge request options set for entire config with model specific options |
| 210 | function applyRequestOptionsToModels( |
| 211 | models: BaseLLM[], |
| 212 | config: Config, |
| 213 | roles: ModelRole[] | undefined = undefined, |
| 214 | ) { |
| 215 | // Prepare models |
| 216 | for (const model of models) { |
| 217 | model.requestOptions = { |
| 218 | ...config.requestOptions, |
| 219 | ...model.requestOptions, |
| 220 | }; |
| 221 | if (roles !== undefined) { |
| 222 | model.roles = model.roles ?? roles; |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | export function isContextProviderWithParams( |
| 228 | contextProvider: CustomContextProvider | ContextProviderWithParams, |
no outgoing calls
no test coverage detected