(creds: QwenOAuthCredentials)
| 187 | } |
| 188 | |
| 189 | private getBaseUrl(creds: QwenOAuthCredentials): string { |
| 190 | let baseUrl = creds.resource_url || "https://dashscope.aliyuncs.com/compatible-mode/v1" |
| 191 | if (!baseUrl.startsWith("http://") && !baseUrl.startsWith("https://")) { |
| 192 | baseUrl = `https://${baseUrl}` |
| 193 | } |
| 194 | return baseUrl.endsWith("/v1") ? baseUrl : `${baseUrl}/v1` |
| 195 | } |
| 196 | |
| 197 | private async callApiWithRetry<T>(apiCall: () => Promise<T>): Promise<T> { |
| 198 | try { |
no outgoing calls
no test coverage detected