import { PromptTemplate } from '../../template.cjs';
import { BaseMessage } from '../../llms/primitives/message.cjs';
import { z } from 'zod';
import '../../errors.cjs';
import '../../internals/types.cjs';
import '../../internals/helpers/guards.cjs';
import '../../internals/serializable.cjs';
import 'ajv';

/**
 * Copyright 2025 IBM Corp.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

type LLMChatPromptTemplate = PromptTemplate.infer<{
    messages: Record<string, string[]>[];
}>;
interface LLMChatTemplate {
    template: LLMChatPromptTemplate;
    messagesToPrompt: (template: LLMChatPromptTemplate) => (messages: BaseMessage[]) => string;
    parameters: {
        stop_sequence: string[];
    };
}
declare function messagesToPromptFactory(rolesOverride?: Record<string, string | undefined>): (template: LLMChatPromptTemplate) => (messages: BaseMessage[]) => string;
declare function templateSchemaFactory(roles: readonly string[]): z.ZodObject<{
    messages: z.ZodArray<z.ZodObject<Record<string, z.ZodArray<z.ZodString, "many">>, "strip", z.ZodTypeAny, {
        [x: string]: string[];
    }, {
        [x: string]: string[];
    }>, "many">;
}, "strip", z.ZodTypeAny, {
    messages: {
        [x: string]: string[];
    }[];
}, {
    messages: {
        [x: string]: string[];
    }[];
}>;
declare class LLMChatTemplates {
    protected static readonly registry: {
        "llama3.3": LLMChatTemplate;
        "llama3.1": LLMChatTemplate;
        llama3: LLMChatTemplate;
        "granite3.1-Instruct": LLMChatTemplate;
    };
    static register(model: string, template: LLMChatTemplate, override?: boolean): void;
    static has(model: string): boolean;
    static get(model: keyof typeof LLMChatTemplates.registry): LLMChatTemplate;
    static get(model: string): LLMChatTemplate;
}

export { type LLMChatPromptTemplate, type LLMChatTemplate, LLMChatTemplates, messagesToPromptFactory, templateSchemaFactory };
