({ baseURL, apiKey })
| 31 | apiKey: String({ title: 'API Key', format: 'password' }) |
| 32 | } |
| 33 | async function openaiGetModelList({ baseURL, apiKey }) { |
| 34 | const resp = await fetch(`${baseURL}/models`, { |
| 35 | headers: { |
| 36 | Authorization: `Bearer ${apiKey}` |
| 37 | } |
| 38 | }) |
| 39 | const { data } = await resp.json() |
| 40 | return data.map(m => m.id) |
| 41 | } |
| 42 | const ProviderTypes: ProviderType[] = [ |
| 43 | { |
| 44 | name: 'openai', |