(options: ModelOptions)
| 45 | }) |
| 46 | |
| 47 | export const configure = (options: ModelOptions) => { |
| 48 | const responsesRoute = configuredResponsesRoute(options) |
| 49 | const chatRoute = configuredChatRoute(options) |
| 50 | const responses = (modelID: string | ModelID) => |
| 51 | responsesRoute.with(withOpenAIOptions(modelID, defaults(options))).model({ id: modelID }) |
| 52 | const chat = (modelID: string | ModelID) => |
| 53 | chatRoute.with(withOpenAIOptions(modelID, defaults(options))).model({ id: modelID }) |
| 54 | return { |
| 55 | id, |
| 56 | model: (modelID: string | ModelID) => (shouldUseResponsesApi(modelID) ? responses(modelID) : chat(modelID)), |
| 57 | responses, |
| 58 | chat, |
| 59 | configure, |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | export const provider = { |
| 64 | id, |
nothing calls this directly
no test coverage detected