ResourceAdditionRequestChunkingConfiguration¶
- class openapi_client.models.resource_addition_request_chunking_configuration.ResourceAdditionRequestChunkingConfiguration(**data)[source]¶
Bases:
BaseModelConfiguration for chunking strategy.
- chunking_strategy: Optional[StrictStr]¶
- max_tokens: Optional[StrictInt]¶
- overlap_percentage: Optional[StrictInt]¶
- max_token_layer2: Optional[StrictInt]¶
- max_token_layer1: Optional[StrictInt]¶
- overlap_tokens: Optional[StrictInt]¶
- buffer_size: Optional[StrictInt]¶
- breakpoint_percentile_threshold: Optional[StrictInt]¶
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'validate_assignment': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod from_json(json_str)[source]¶
Create an instance of ResourceAdditionRequestChunkingConfiguration from a JSON string
- Return type:
Optional[Self]
- to_dict()[source]¶
Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic’s self.model_dump(by_alias=True):
None is only added to the output dict for nullable fields that were set at model initialization. Other fields with value None are ignored.
- Return type:
Dict[str,Any]
- classmethod from_dict(obj)[source]¶
Create an instance of ResourceAdditionRequestChunkingConfiguration from a dict
- Return type:
Optional[Self]
- model_fields: ClassVar[dict[str, FieldInfo]] = {'breakpoint_percentile_threshold': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='BreakpointPercentileThreshold', alias_priority=2, description='The breakpoint percentile threshold to use for semantic chunking.'), 'buffer_size': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='BufferSize', alias_priority=2, description='The buffer size to use for semantic chunking.'), 'chunking_strategy': FieldInfo(annotation=Union[Annotated[str, Strict(strict=True)], NoneType], required=False, alias='ChunkingStrategy', alias_priority=2, description='The chunking strategy to use.'), 'max_token_layer1': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='MaxTokenLayer1', alias_priority=2, description='The maximum number of tokens to use for hierarchical chunking layer 1.'), 'max_token_layer2': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='MaxTokenLayer2', alias_priority=2, description='The maximum number of tokens to use for hierarchical chunking layer 2.'), 'max_tokens': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='MaxTokens', alias_priority=2, description='The maximum number of tokens to use for fixed size chunking.'), 'overlap_percentage': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='OverlapPercentage', alias_priority=2, description='The overlap percentage to use for fixed size chunking.'), 'overlap_tokens': FieldInfo(annotation=Union[Annotated[int, Strict(strict=True)], NoneType], required=False, alias='OverlapTokens', alias_priority=2, description='The overlap tokens between the 2 layers used for hierarchical chunking.')}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- model_post_init(__context)¶
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel) – The BaseModel instance.__context (
Any) – The context.
- Return type:
None