import { PromptTemplate } from '../../template.js'; import { BaseMessage } from '../../llms/primitives/message.js'; import { z } from 'zod'; import '../../errors.js'; import '../../internals/types.js'; import '../../internals/helpers/guards.js'; import '../../internals/serializable.js'; 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[]; }>; interface LLMChatTemplate { template: LLMChatPromptTemplate; messagesToPrompt: (template: LLMChatPromptTemplate) => (messages: BaseMessage[]) => string; parameters: { stop_sequence: string[]; }; } declare function messagesToPromptFactory(rolesOverride?: Record): (template: LLMChatPromptTemplate) => (messages: BaseMessage[]) => string; declare function templateSchemaFactory(roles: readonly string[]): z.ZodObject<{ messages: z.ZodArray>, "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 };