6b7e6b44f1
gh-pages / build (push) Waiting to run
Python Publish (pypi) / Upload release to PyPI (push) Waiting to run
Spellcheck / spellcheck (push) Waiting to run
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
37 lines
1.0 KiB
Python
37 lines
1.0 KiB
Python
# Copyright (c) 2024 Microsoft Corporation.
|
|
# Licensed under the MIT License
|
|
|
|
"""Parameterization settings for the default configuration."""
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from graphrag_chunking.chunk_strategy_type import ChunkerType
|
|
|
|
|
|
class ChunkingConfig(BaseModel):
|
|
"""Configuration section for chunking."""
|
|
|
|
model_config = ConfigDict(extra="allow")
|
|
"""Allow extra fields to support custom cache implementations."""
|
|
|
|
type: str = Field(
|
|
description="The chunking type to use.",
|
|
default=ChunkerType.Tokens,
|
|
)
|
|
encoding_model: str | None = Field(
|
|
description="The encoding model to use.",
|
|
default=None,
|
|
)
|
|
size: int = Field(
|
|
description="The chunk size to use.",
|
|
default=1200,
|
|
)
|
|
overlap: int = Field(
|
|
description="The chunk overlap to use.",
|
|
default=100,
|
|
)
|
|
prepend_metadata: list[str] | None = Field(
|
|
description="Metadata fields from the source document to prepend on each chunk.",
|
|
default=None,
|
|
)
|