파일 설정 객체 구조
개요
fileConfig 객체를 사용하면 크기 제한 및 MIME 유형 제한을 포함하여 애플리케이션의 파일 처리 설정을 구성할 수 있습니다. 이 섹션에서는 fileConfig 객체 구조에 대한 자세한 분석을 제공합니다.
fileConfig 아래에는 8개의 주요 필드가 있습니다:
endpointsserverFileSizeLimitavatarSizeLimitimageGenerationfileTokenLimitocrtextstt
참고:
- 이 글을 작성하는 시점 기준으로, Assistants endpoint는 이 목록에 있는 파일 형식들을 지원합니다.
- OpenAI, Azure OpenAI, Google 및 Custom endpoint는 RAG API를 통해 파일을 지원합니다.
- OpenAI, Azure OpenAI, Anthropic, Google 및 AWS Bedrock endpoint는 Upload to Provider를 통한 직접 파일 업로드를 지원합니다.
ocr,text, 및stt섹션은 Upload as Text 및 OCR과 같은 기능을 위한 파일 처리를 제어합니다.- Plugins과 같이 언급되지 않은 다른 endpoint들은 (아직) 파일 업로드를 지원하지 않습니다.
- Assistants endpoint는
assistants라는 정의된 endpoint 값을 가집니다. 다른 모든 endpoint는default라는 정의된 값을 사용합니다.- 어시스턴트가 아닌 endpoint의 경우,
default아래에서 모든 endpoint에 대한 파일 설정을 조정할 수 있습니다. - 특정 endpoint에 대한 설정을 조정하려면 해당 endpoint 이름을 나열할 수 있습니다:
assistants- 다른 것들과 별도로 정의된 기본값을 가지고 있으므로 "default"를 사용하지 않습니다.
openAIazureOpenAIgooglebedrockYourCustomEndpointName
- 어시스턴트가 아닌 endpoint의 경우,
- 값을 생략할 수 있으며, 이 경우 앱은 아래 나열된 endpoint 유형별로 정의된 기본값을 사용합니다.
- LibreChat은 1메가바이트를 다음과 같이 계산합니다:
1 x 1024 x 1024
예시
fileConfig:
endpoints:
assistants:
fileLimit: 5
fileSizeLimit: 10
totalSizeLimit: 50
supportedMimeTypes:
- "image/.*"
- "application/pdf"
openAI:
disabled: true
default:
totalSizeLimit: 20
YourCustomEndpointName:
fileLimit: 5
fileSizeLimit: 1000
supportedMimeTypes:
- "image/.*"
serverFileSizeLimit: 1000
avatarSizeLimit: 2
fileTokenLimit: 100000
imageGeneration:
percentage: 100
px: 1024
ocr:
supportedMimeTypes:
- "^image/(jpeg|gif|png|webp|heic|heif)$"
- "^application/pdf$"
- "^application/vnd\\.openxmlformats-officedocument\\.(wordprocessingml\\.document|presentationml\\.presentation|spreadsheetml\\.sheet)$"
- "^application/vnd\\.ms-(word|powerpoint|excel)$"
- "^application/epub\\+zip$"
text:
supportedMimeTypes:
- "^text/(plain|markdown|csv|json|xml|html|css|javascript|typescript|x-python|x-java|x-csharp|x-php|x-ruby|x-go|x-rust|x-kotlin|x-swift|x-scala|x-perl|x-lua|x-shell|x-sql|x-yaml|x-toml)$"
stt:
supportedMimeTypes:
- "^audio/(mp3|mpeg|mpeg3|wav|wave|x-wav|ogg|vorbis|mp4|x-m4a|flac|x-flac|webm)$"serverFileSizeLimit
| Key | Type | Description | Example |
|---|---|---|---|
| serverFileSizeLimit | Integer | 서버에 업로드되는 모든 파일의 최대 크기(메가바이트(MB) 단위)입니다. | Acts as an overarching limit for file uploads across all endpoints, ensuring that no file exceeds this size server-wide. |
fileConfig:
serverFileSizeLimit: 1000avatarSizeLimit
| Key | Type | Description | Example |
|---|---|---|---|
| avatarSizeLimit | Integer | 아바타 이미지에 허용되는 최대 크기(메가바이트(MB) 단위)입니다. | Specifically tailored for user avatar uploads, allowing for control over image sizes to maintain consistent quality and loading times. |
fileConfig:
avatarSizeLimit: 2imageGeneration
| Key | Type | Description | Example |
|---|---|---|---|
| imageGeneration | Object | 이미지 생성 출력 품질 및 크기 관련 설정입니다. | Allows configuration of either output size as a percentage relative to some base size or as an explicit pixel dimension. |
imageGeneration은(는) 다음 매개변수를 지원합니다:
-
percentage(정수)- 생성된 이미지의 출력 크기를 백분율로 나타낸 값입니다 (예:
100은 기본 크기의 100%를 의미합니다). - 기본 크기 또는 원본 크기를 기준으로 출력 이미지의 배율을 조정하려면 이 설정을 사용하세요.
- 생성된 이미지의 출력 크기를 백분율로 나타낸 값입니다 (예:
-
px(정수)- 출력 이미지의 크기를 픽셀 단위로 지정합니다(예:
1024). - 기본 크기와 관계없이 생성된 이미지의 출력 크기를 명시적으로 설정하려면 이를 사용하세요.
- 출력 이미지의 크기를 픽셀 단위로 지정합니다(예:
사용 사례에 따라 이 매개변수(percentage 또는 px) 중 하나만 설정할 수 있으며, 둘 다 설정할 수는 없습니다.
설정 예시:
fileConfig:
imageGeneration:
percentage: 100
px: 1024fileTokenLimit
| Key | Type | Description | Example |
|---|---|---|---|
| fileTokenLimit | Number | 프롬프트에 포함할 텍스트 파일의 최대 토큰 수(잘리기 전). | fileTokenLimit: 100000 |
설명: 텍스트 콘텐츠를 첨부할 때, LibreChat은 프롬프트 구성 직전에 설정된 토큰 제한에 맞춰 런타임에 텍스트를 자릅니다.
기본값: 100000
fileConfig:
fileTokenLimit: 100000ocr
| Key | Type | Description | Example |
|---|---|---|---|
| ocr | Object | OCR(광학 문자 인식) 파일 처리를 위한 설정. | Configures which file types are processed using OCR. |
설명: ocr 섹션은 시각적 문서에서 텍스트를 추출하기 위해 OCR 기능을 사용하여 처리할 파일 형식을 구성합니다.
참고: 이 섹션은 OCR 처리를 위한 파일 형식 일치를 제어합니다. 에이전트 기능을 활성화하고 OCR 서비스를 구성하려면 다음을 참조하세요:
ocr및context기능을 위한 Agents Configuration- OCR Configuration (OCR 서비스 설정을 위한 OCR 구성)
supportedMimeTypes
| Key | Type | Description | Example |
|---|---|---|---|
| supportedMimeTypes | Array of Strings | OCR로 처리할 파일의 MIME 유형 패턴 목록입니다. | Uses regular expressions to match file types. |
기본값: 이미지, PDF 및 Office 문서
fileConfig:
ocr:
supportedMimeTypes:
- "^image/(jpeg|gif|png|webp|heic|heif)$"
- "^application/pdf$"
- "^application/vnd\\.openxmlformats-officedocument\\.(wordprocessingml\\.document|presentationml\\.presentation|spreadsheetml\\.sheet)$"
- "^application/vnd\\.ms-(word|powerpoint|excel)$"
- "^application/epub\\+zip$"text
| Key | Type | Description | Example |
|---|---|---|---|
| text | Object | OCR을 사용하지 않는 직접적인 텍스트 파일 파싱 설정. | Configures which file types are processed as plain text files for direct content extraction. |
설명: text 섹션은 직접적인 텍스트 추출을 사용하여 처리할 파일 형식을 구성합니다.
참고: 텍스트 파싱은 "텍스트로 업로드(Upload as Text)" 기능에서 사용하는 기본 메서드입니다(context 기능으로 제어됨). 먼저 RAG API의 텍스트 파싱 라이브러리를 사용하려고 시도하며, RAG API가 연결되어 있지 않은 경우 외부 서비스 없이 더 간단한 텍스트 추출 메서드로 대체됩니다. 자세한 내용은 텍스트로 업로드(/docs/features/upload_as_text)를 참조하세요.
supportedMimeTypes
| Key | Type | Description | Example |
|---|---|---|---|
| supportedMimeTypes | Array of Strings | 일반 텍스트로 파싱해야 하는 파일의 MIME 유형 패턴 목록입니다. | Uses regular expressions to match file types. |
기본값: 모든 텍스트 파일 및 일반적인 프로그래밍 언어
fileConfig:
text:
supportedMimeTypes:
- "^text/(plain|markdown|csv|json|xml|html|css|javascript|typescript|x-python|x-java|x-csharp|x-php|x-ruby|x-go|x-rust|x-kotlin|x-swift|x-scala|x-perl|x-lua|x-shell|x-sql|x-yaml|x-toml)$"stt
| Key | Type | Description | Example |
|---|---|---|---|
| stt | Object | 음성-텍스트 변환(STT) 오디오 파일 처리를 위한 설정입니다. | Configures which audio file types are processed using STT for transcription. |
설명: stt 섹션은 오디오를 텍스트로 변환하는 Speech-to-Text 기능을 사용하여 처리할 오디오 파일 유형을 구성합니다.
supportedMimeTypes
| Key | Type | Description | Example |
|---|---|---|---|
| supportedMimeTypes | Array of Strings | STT로 전사할 오디오 파일의 MIME 유형 패턴 목록입니다. | Uses regular expressions to match audio file types. |
기본값: 일반적인 오디오 형식
fileConfig:
stt:
supportedMimeTypes:
- "^audio/(mp3|mpeg|mpeg3|wav|wave|x-wav|ogg|vorbis|mp4|x-m4a|flac|x-flac|webm)$"참고:
text패턴과 일치하는 파일은 단순 텍스트 추출 방식으로 처리됩니다.ocr패턴과 일치하는 파일은 제공된 OCR 서비스를 사용하여 처리됩니다.stt패턴과 일치하는 파일은 Speech-to-Text 전사로 처리됩니다.- 처리 우선순위: OCR > STT > 텍스트 파싱 > 폴백
- 어떤 패턴과도 일치하지 않는 파일은 텍스트 파싱으로 대체됩니다.
파일 처리 우선순위
LibreChat은 다음 우선순위에 따라 MIME 유형 매칭을 기반으로 업로드된 파일을 처리합니다:
- OCR - 파일이
ocr.supportedMimeTypes와 일치하고 OCR이 구성된 경우 - STT - 파일이
stt.supportedMimeTypes와 일치하고 STT가 구성된 경우 - 텍스트 파싱 - 파일이
text.supportedMimeTypes와 일치하는 경우 - Fallback - 최후의 수단으로 텍스트 파싱
이 처리 순서는 특수 서비스(OCR/STT)가 구성되지 않은 경우에도 기능을 유지하면서 최적의 추출 품질을 보장합니다.
처리 예시
OCR이 구성된 PDF 파일:
- 파일이
ocr.supportedMimeTypes와 일치합니다 - OCR을 사용하여 텍스트를 추출합니다
- 스캔된 PDF 및 이미지에 대한 더 나은 품질
OCR이 구성되지 않은 PDF 파일:
text.supportedMimeTypes와 일치하는 파일(또는 대체 항목 사용)- 텍스트 파싱 라이브러리를 사용합니다
- 텍스트 선택이 가능한 디지털 PDF에 잘 작동합니다
Python 파일:
text.supportedMimeTypes와 일치하는 파일- 텍스트 파싱 사용 (OCR 불필요)
- 직접 텍스트 추출
STT가 구성된 오디오 파일:
stt.supportedMimeTypes와 일치하는 파일- STT를 사용하여 오디오를 텍스트로 변환합니다
OCR이 구성되지 않은 이미지 파일:
- 파일이
ocr.supportedMimeTypes와 일치하지만 OCR을 사용할 수 없습니다 - 텍스트 파싱으로 대체
- OCR 없는 제한된 추출 기능
이 우선순위 시스템을 통해 "Upload as Text"와 같은 기능이 OCR 구성 없이도 작동할 수 있으며, 동시에 OCR을 사용할 수 있는 경우 이를 활용하여 추출 품질을 향상시킬 수 있습니다.
endpoints
| Key | Type | Description | Example |
|---|---|---|---|
| endpoints | Record/Object | 개별 endpoint에 대한 파일 처리 설정을 구성하여 endpoint별로 사용자 정의할 수 있습니다. | Specifies file handling configurations for individual endpoints, allowing customization per endpoint basis. |
설명: endpoints 아래의 각 객체는 다음과 같은 설정을 가질 수 있는 레코드입니다:
개요
disabled- 해당 endpoint에 대해 파일 처리가 비활성화되었는지 여부입니다.
fileLimit- 업로드 요청당 허용되는 최대 파일 수입니다.
fileSizeLimit- 단일 파일의 최대 크기입니다. 단위는 MB입니다 (예: 20메가바이트의 경우
20사용).
- 단일 파일의 최대 크기입니다. 단위는 MB입니다 (예: 20메가바이트의 경우
totalSizeLimit- 단일 요청 내 모든 파일의 총 최대 크기입니다. 단위는 MB입니다 (예: 20메가바이트의 경우
20사용).
- 단일 요청 내 모든 파일의 총 최대 크기입니다. 단위는 MB입니다 (예: 20메가바이트의 경우
supportedMimeTypes- 업로드할 수 있는 MIME 타입을 지정하는 Regular Expressions 목록입니다. 파일 형식을 제한하기 위해 이를 사용자 지정할 수 있습니다.
disabled
| Key | Type | Description | Example |
|---|---|---|---|
| disabled | Boolean | 특정 endpoint에 대해 파일 업로드가 비활성화되었는지 여부를 나타냅니다. | Setting this to `true` prevents any file uploads to the specified endpoint, overriding any other file-related settings. |
기본값: false
openAI:
disabled: truefileLimit
키:
| Key | Type | Description | Example |
|---|---|---|---|
| fileLimit | Integer | 단일 업로드 요청에서 허용되는 최대 파일 수입니다. | Helps control the volume of uploads and manage server load. |
기본값: endpoint에 따라 다름
assistants:
fileLimit: 5fileSizeLimit
키:
| Key | Type | Description | Example |
|---|---|---|---|
| fileSizeLimit | Integer | 각 개별 파일에 허용되는 최대 크기(메가바이트(MB) 단위)입니다. | This limit ensures that no single file exceeds the specified size, allowing for better resource allocation and management. |
기본값: endpoint에 따라 다름
YourCustomEndpointName:
fileSizeLimit: 1000totalSizeLimit
키:
| Key | Type | Description | Example |
|---|---|---|---|
| totalSizeLimit | Integer | 단일 요청 내 모든 파일에 허용되는 최대 총 크기(메가바이트(MB) 단위). | This setting is crucial for preventing excessive bandwidth and storage usage by any single upload request. |
기본값: endpoint에 따라 다름
assistants:
totalSizeLimit: 50supportedMimeTypes
키:
| Key | Type | Description | Example |
|---|---|---|---|
| supportedMimeTypes | Array of Strings | 업로드 허용 MIME 타입을 정의하는 정규 표현식 목록입니다. | This allows for precise control over the types of files that can be uploaded. Invalid regex is ignored. |
기본값: endpoint에 따라 다름
assistants:
supportedMimeTypes:
- "image/.*"
- "application/pdf"이 가이드는 어떤가요?