wwf
2 天以前 a430284aa21e3ae1f0d5654e55b2ad2852519cc2
app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx
@@ -48,7 +48,6 @@
  renderTrigger?: (v: TriggerProps) => ReactNode
  readonly?: boolean
  isInWorkflow?: boolean
  scope?: string
}
const stopParameterRule: ModelParameterRule = {
  default: [],
@@ -69,7 +68,7 @@
  },
}
const PROVIDER_WITH_PRESET_TONE = ['langgenius/openai/openai', 'langgenius/azure_openai/azure_openai']
const PROVIDER_WITH_PRESET_TONE = ['openai', 'azure_openai']
const ModelParameterModal: FC<ModelParameterModalProps> = ({
  popupClassName,
  portalToFollowElemContentClassName,
@@ -191,22 +190,26 @@
              )
          }
        </PortalToFollowElemTrigger>
        <PortalToFollowElemContent className={cn('z-[60]', portalToFollowElemContentClassName)}>
          <div className={cn(popupClassName, 'w-[389px] rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg shadow-lg')}>
            <div className={cn('max-h-[420px] overflow-y-auto p-4 pt-3')}>
              <div className='relative'>
                <div className={cn('system-sm-semibold mb-1 flex h-6 items-center text-text-secondary')}>
        <PortalToFollowElemContent className={cn(portalToFollowElemContentClassName, 'z-[60]')}>
          <div className={cn(popupClassName, 'w-[496px] rounded-xl border border-gray-100 bg-white shadow-xl')}>
            <div className={cn(
              'max-h-[480px]  overflow-y-auto',
              !isInWorkflow && 'px-10 pt-6 pb-8',
              isInWorkflow && 'p-4')}>
              <div className='flex items-center justify-between h-8'>
                <div className={cn('font-semibold text-gray-900 shrink-0', isInWorkflow && 'text-[13px]')}>
                  {t('common.modelProvider.model').toLocaleUpperCase()}
                </div>
                <ModelSelector
                  defaultModel={(provider || modelId) ? { provider, model: modelId } : undefined}
                  modelList={activeTextGenerationModelList}
                  onSelect={handleChangeModel}
                  triggerClassName='max-w-[295px]'
                />
              </div>
              {
                !!parameterRules.length && (
                  <div className='my-3 h-[1px] bg-divider-subtle' />
                  <div className='my-5 h-[1px] bg-gray-100' />
                )
              }
              {
@@ -216,8 +219,8 @@
              }
              {
                !isLoading && !!parameterRules.length && (
                  <div className='mb-2 flex items-center justify-between'>
                    <div className={cn('system-sm-semibold flex h-6 items-center text-text-secondary')}>{t('common.modelProvider.parameters')}</div>
                  <div className='flex items-center justify-between mb-4'>
                    <div className={cn('font-semibold text-gray-900', isInWorkflow && 'text-[13px]')}>{t('common.modelProvider.parameters')}</div>
                    {
                      PROVIDER_WITH_PRESET_TONE.includes(provider) && (
                        <PresetsParameter onSelect={handleSelectPresetParameter} />
@@ -234,6 +237,7 @@
                  ].map(parameter => (
                    <ParameterItem
                      key={`${modelId}-${parameter.name}`}
                      className='mb-4'
                      parameterRule={parameter}
                      value={completionParams?.[parameter.name]}
                      onChange={v => handleParamChange(parameter.name, v)}
@@ -246,7 +250,7 @@
            </div>
            {!hideDebugWithMultipleModel && (
              <div
                className='bg-components-section-burn system-sm-regular flex h-[50px] cursor-pointer items-center justify-between rounded-b-xl border-t border-t-divider-subtle px-4 text-text-accent'
                className='flex items-center justify-between px-6 h-[50px] bg-gray-50 border-t border-t-gray-100 text-xs font-medium text-primary-600 cursor-pointer rounded-b-xl'
                onClick={() => onDebugWithMultipleModelChange?.()}
              >
                {
@@ -254,7 +258,7 @@
                    ? t('appDebug.debugAsSingleModel')
                    : t('appDebug.debugAsMultipleModel')
                }
                <ArrowNarrowLeft className='h-3 w-3 rotate-180' />
                <ArrowNarrowLeft className='w-3 h-3 rotate-180' />
              </div>
            )}
          </div>