/**
 * SKG internal provider config.
 * The browser never receives upstream model keys; all generation goes through /api.
 */

export const PROVIDERS = {
  skg: {
    label: 'SKG 内部模型',
    defaultBaseUrl: '/api',
    endpoints: {
      chat: '/creative/copy',
      image: '/jobs/{jobId}/frames/{idx}/generate',
      video: '/jobs/{jobId}/frames/{idx}/storyboard/video',
      videoQuery: '/jobs/{jobId}'
    },
    requestAdapter: {
      chat: (params) => params,
      image: (params) => params,
      video: (params) => params
    },
    responseAdapter: {
      chat: (response) => response,
      image: (response) => response,
      video: (response) => response
    }
  },
  default: 'skg'
}

export const getProviderList = () => (
  Object.entries(PROVIDERS)
    .filter(([key]) => key !== 'default')
    .map(([key, value]) => ({ key, label: value.label }))
)

export const getDefaultProvider = () => PROVIDERS.default || 'skg'

export const getProviderConfig = (provider) => PROVIDERS[provider] || PROVIDERS.skg

export const getDefaultBaseUrl = (provider) => getProviderConfig(provider).defaultBaseUrl
