(provider, apiKey)
| 48 | |
| 49 | // Set API key |
| 50 | setAPIKey(provider, apiKey) { |
| 51 | if (this.apiConfigs[provider]) { |
| 52 | if (provider === 'openai' || provider === 'qwen' || provider === 'glm') { |
| 53 | this.apiConfigs[provider].headers['Authorization'] = `Bearer ${apiKey}`; |
| 54 | } else if (provider === 'ernie') { |
| 55 | this.apiConfigs[provider].accessToken = apiKey; |
| 56 | } |
| 57 | return true; |
| 58 | } |
| 59 | return false; |
| 60 | } |
| 61 | |
| 62 | // Switch AI service provider |
| 63 | switchProvider(provider) { |
nothing calls this directly
no outgoing calls
no test coverage detected