(url: string)
| 1794 | |
| 1795 | const normalizeGeminiBaseUrl = (url: string): string => { |
| 1796 | try { |
| 1797 | const u = new URL(url); |
| 1798 | u.pathname = u.pathname.replace(/\/+$/, ""); |
| 1799 | if (u.pathname === "" || u.pathname === "/") { |
| 1800 | u.pathname = "/v1beta"; |
| 1801 | } |
| 1802 | if (!u.pathname.startsWith("/v1beta")) { |
| 1803 | u.pathname = "/v1beta"; |
| 1804 | } |
| 1805 | u.search = ""; |
| 1806 | u.hash = ""; |
| 1807 | return u.toString(); |
| 1808 | } catch { |
| 1809 | return url; |
| 1810 | } |
| 1811 | }; |
| 1812 | |
| 1813 | const parseOpenAIChatResponse = ( |
| 1814 | data: any, |
| 1815 | ): { text: string; images: AIImage[] } => { |
no outgoing calls
no test coverage detected