index.tsx

Overview

index.tsx defines and exports the SystemModelSettingModal React component. This component renders a modal dialog that allows users to configure various system model settings related to large language models (LLMs) and related AI capabilities, such as chat, embedding, image-to-text, speech-to-text, reranking, and text-to-speech models.

The modal fetches initial system model settings and available model options on mount, displays them in a form with dropdown selectors, and provides validation and submission handling. It integrates with the application’s localization system to display translated labels and tooltips.

This file’s primary role is to provide a user interface for managing system-wide AI model configuration settings in a modal dialog, making it a critical part of the system administration or settings section in the application.


Detailed Explanation

Component: SystemModelSettingModal

Description

A controlled modal dialog component that shows a form for selecting various LLM-related system model settings. It leverages Ant Design (antd) components for UI and form handling, custom hooks for data fetching and translations, and callbacks for submitting updated settings.

Props

Prop Name

Type

Description

visible

boolean

Controls the visibility of the modal dialog.

hideModal

() => void

Callback to close/hide the modal.

loading

boolean

Indicates if a submission or loading process is ongoing (disables submit button).

onOk

[(payload: Omit<ISystemModelSettingSavingParams, 'tenant_id'

'name'>) => void](/projects/311/72849)

Internal State and Hooks

Methods

Rendered JSX Structure