* 测试列表中的图片服务商
(name: string, provider: Provider)
| 498 | * 测试列表中的图片服务商 |
| 499 | */ |
| 500 | async function testImageProviderInList(name: string, provider: Provider) { |
| 501 | try { |
| 502 | const result = await testConnection({ |
| 503 | type: provider.type, |
| 504 | provider_name: name, |
| 505 | api_key: undefined, |
| 506 | base_url: provider.base_url, |
| 507 | endpoint_type: provider.endpoint_type, |
| 508 | model: provider.model |
| 509 | }) |
| 510 | if (result.success) { |
| 511 | setSuccess(`${name} 连接成功`) |
| 512 | } |
| 513 | } catch (e: any) { |
| 514 | setError(e, `${name} 连接失败`) |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | /** |
| 519 | * 更新文本表单数据 |
nothing calls this directly
no test coverage detected