Skip to main content

Namespace: ChatMLPrompt

Functions

chat

chat(): TextGenerationPromptTemplate<ChatPrompt, string>

Formats a chat prompt using the ChatML format.

ChatML prompt template:

<|im_start|>system
You are a helpful assistant that answers questions about the world.<|im_end|>
<|im_start|>user
What is the capital of France?<|im_end|>
<|im_start|>assistant
Paris<|im_end|>

Returns

TextGenerationPromptTemplate<ChatPrompt, string>

Defined in

packages/modelfusion/src/model-function/generate-text/prompt-template/ChatMLPromptTemplate.ts:79


instruction

instruction(): TextGenerationPromptTemplate<InstructionPrompt, string>

Formats an instruction prompt using the ChatML format.

ChatML prompt template:

<|im_start|>system
${ system prompt }<|im_end|>
<|im_start|>user
${ instruction }<|im_end|>
<|im_start|>assistant
${response prefix}

Returns

TextGenerationPromptTemplate<InstructionPrompt, string>

Defined in

packages/modelfusion/src/model-function/generate-text/prompt-template/ChatMLPromptTemplate.ts:47


text

text(): TextGenerationPromptTemplate<string, string>

Formats a text prompt using the ChatML format.

Returns

TextGenerationPromptTemplate<string, string>

Defined in

packages/modelfusion/src/model-function/generate-text/prompt-template/ChatMLPromptTemplate.ts:24