# utils.schemas.utils – Axolotl

# utils.schemas.utils

`utils.schemas.utils`

Utilities for Axolotl Pydantic models

## Functions

Name | Description
--- | ---
handle_legacy_message_fields_logic | Handle backwards compatibility between legacy message field mapping and new property mapping system.

### handle_legacy_message_fields_logic

    utils.schemas.utils.handle_legacy_message_fields_logic(data)

Handle backwards compatibility between legacy message field mapping and new property mapping system.

Previously, the config only supported mapping ‘role’ and ‘content’ fields via dedicated config options: - message_field_role: Mapped to the role field - message_field_content: Mapped to the content field

The new system uses message_property_mappings to support arbitrary field mappings: message_property_mappings: role: source_role_field content: source_content_field additional_field: source_field

#### Parameters

Name | Type | Description | Default
--- | --- | --- | ---
data | dict | Dictionary containing configuration data | required

#### Returns

Name | Type | Description
--- | --- | ---
| dict | Updated dictionary with message field mappings consolidated

#### Raises

Name | Type | Description
--- | --- | ---
| ValueError | If there are conflicts between legacy and new mappings