* Returns true when the given URL targets the OpenAI Responses API. * Detection is based on whether the URL path ends with `/responses` (before any query string). * This covers both the standard OpenAI endpoint (`https://api.openai.com/v1/responses`) and * Azure OpenAI deployments that end with `
(url: string)
| 317 | * Azure OpenAI deployments that end with `/responses?api-version=...`. |
| 318 | */ |
| 319 | function isResponsesApiUrl(url: string): boolean { |
| 320 | try { |
| 321 | return new URL(url).pathname.endsWith("/responses"); |
| 322 | } catch { |
| 323 | // Fallback for relative or non-standard URLs |
| 324 | return url.split("?")[0].endsWith("/responses"); |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | /** |
| 329 | * Sleeps for the given number of milliseconds. |
no outgoing calls
no test coverage detected