import { createTypedValidator } from '@takeshape/json-schema';
export const shapeName = 'TSHybridSearchArgs';
export const schema = {
    type: 'object',
    properties: {
        terms: {
            type: 'string',
            description: 'The text to search for. Drives both keyword matching and embedding generation.'
        },
        from: {
            type: 'integer',
            description: 'A number of results to skip before starting to collect the result set. This is useful for pagination.'
        },
        size: {
            type: 'integer',
            maximum: 250,
            description: 'The maximum number of items to return.'
        },
        filter: {
            description: 'An elasticsearch style filter. Overrides onlyEnabled.'
        },
        sort: {
            type: 'array',
            description: 'The fields to sort the results by.',
            items: {
                type: 'object',
                properties: {
                    field: {
                        type: 'string'
                    },
                    order: {
                        type: 'string',
                        enum: ['asc', 'desc']
                    }
                },
                required: ['field', 'order'],
                additionalProperties: false
            }
        },
        config: {
            type: 'object',
            properties: {
                keywordWeight: {
                    type: 'number',
                    description: 'Weight factor for keyword search results. Default: 0.5'
                },
                vectorWeight: {
                    type: 'number',
                    description: 'Weight factor for vector search results. Default: 0.5'
                },
                vectorK: {
                    type: 'integer',
                    minimum: 1,
                    description: 'Number of nearest neighbors for vector search. Default: 3'
                }
            },
            additionalProperties: false
        }
    },
    additionalProperties: false
};
export const validate = createTypedValidator(schema, {
    useDefaults: true
});
