model-config.ts 686 B

1234567891011121314151617181920212223
  1. import { useSettingsStore } from '@/lib/store/settings';
  2. /**
  3. * Get current model configuration from settings store
  4. */
  5. export function getCurrentModelConfig() {
  6. const { providerId, modelId, providersConfig } = useSettingsStore.getState();
  7. const modelString = `${providerId}:${modelId}`;
  8. // Get current provider's config
  9. const providerConfig = providersConfig[providerId];
  10. return {
  11. providerId,
  12. modelId,
  13. modelString,
  14. apiKey: providerConfig?.apiKey || '',
  15. baseUrl: providerConfig?.baseUrl || '',
  16. providerType: providerConfig?.type,
  17. requiresApiKey: providerConfig?.requiresApiKey,
  18. isServerConfigured: providerConfig?.isServerConfigured,
  19. };
  20. }