* 测试文本服务商连接(弹窗中)
()
| 315 | * 测试文本服务商连接(弹窗中) |
| 316 | */ |
| 317 | async function testTextConnection() { |
| 318 | testingText.value = true |
| 319 | try { |
| 320 | const result = await testConnection({ |
| 321 | type: textForm.value.type, |
| 322 | provider_name: editingTextProvider.value || undefined, |
| 323 | api_key: textForm.value.api_key || undefined, |
| 324 | base_url: textForm.value.base_url, |
| 325 | endpoint_type: textForm.value.endpoint_type, |
| 326 | model: textForm.value.model |
| 327 | }) |
| 328 | if (result.success) { |
| 329 | setSuccess(result.message || '连接成功') |
| 330 | } |
| 331 | } catch (e: any) { |
| 332 | setError(e, '连接失败') |
| 333 | } finally { |
| 334 | testingText.value = false |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * 测试列表中的文本服务商 |
nothing calls this directly
no test coverage detected